BUG 0000 "Safe upgrade for JavaScript files" SOLVED

- Added validation, when translation file is "translation.enterprise.xxxxx.js"
* Available from version ProcessMaker-2.5
This commit is contained in:
Victor Saisa Lopez
2013-05-02 12:51:36 -04:00
parent e7d345b840
commit cfb4f1f639

View File

@@ -580,9 +580,15 @@ class Bootstrap
if (strtolower($typefile) == 'js' && $typearray[0] == 'translation') {
Bootstrap::sendHeaders($filename, 'text/javascript', $download, $downloadFileName);
$filename = str_replace(implode(".", $typearray), $typearray[0] . "." . $typearray[1] . "." . $typearray[count($typearray) - 1], $filename);
if ($typearray[1] != "enterprise") {
$arrayAux = array($typearray[0], $typearray[1], $typearray[count($typearray) - 1]);
$output = Bootstrap::streamJSTranslationFile($filename, $typearray[1]);
$filename = str_replace(implode(".", $typearray), implode(".", $arrayAux), $filename);
$typearray = $arrayAux;
}
$output = Bootstrap::streamJSTranslationFile($filename, $typearray[count($typearray) - 2]);
echo $output;