Remove first / when importing files

This commit is contained in:
Némunaire 2015-01-13 07:07:26 +01:00 committed by Nemunaire
commit f1870a8555
2 changed files with 7 additions and 2 deletions

View file

@ -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))