Revert FAT32 filename collisions

#363 has been implicated in a glitch in the docker template system.  While I cannot replicate the issue at all, revert the PR as the edge case issue that it solved has only ever occurred during synthetic tests.
This commit is contained in:
Squidly271
2018-11-10 09:05:33 -05:00
committed by GitHub
parent 3bc513d569
commit b01d5ae55d

View File

@@ -81,16 +81,7 @@ if (isset($_POST['contName'])) {
$userTmplDir = $dockerManPaths['templates-user'];
if (!is_dir($userTmplDir)) mkdir($userTmplDir, 0777, true);
if ($Name) {
$filename = sprintf('%s/my-%s', $userTmplDir, $Name);
// look for FAT32 filename hits due to different case
$userTemplates = glob("$userTmplDir/*.xml");
foreach ($userTemplates as $tmpl) {
if ( ($tmpl != "$filename.xml") && (strcasecmp($tmpl,"$filename.xml") == 0) ) {
$filename .= " (1)";
break;
}
}
$filename .= ".xml";
$filename = sprintf('%s/my-%s.xml', $userTmplDir, $Name);
file_put_contents($filename, $postXML);
}
// Run dry