Remove first / when importing files
This commit is contained in:
parent
158426f372
commit
f1870a8555
2 changed files with 7 additions and 2 deletions
|
|
@ -61,10 +61,16 @@ if (!empty($_FILES["inputFile"]['tmp_name']))
|
|||
$child->nodeValue);
|
||||
|
||||
else if ($child->nodeName == "file")
|
||||
{
|
||||
$path = $child->getAttribute("path");
|
||||
if ($path[0] == "/")
|
||||
$path = substr($path, 1);
|
||||
|
||||
$ex->add_file(
|
||||
$child->getAttribute("path"),
|
||||
$path,
|
||||
$child->nodeValue,
|
||||
$child->getAttribute("sha1"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!$theme->add_exercice($ex))
|
||||
|
|
|
|||
Reference in a new issue