47,24 → 47,30 |
} |
} |
|
$translation_array = array(); |
foreach (OIDplus::getAllPluginManifests('language') as $pluginManifest) { |
$xmldata = $pluginManifest->getRawXml(); |
$lang = $xmldata->language->code->__toString(); |
$translation_array[$lang] = array(); |
if (strpos($lang,'/') !== false) return $str; // prevent attack (but actually, the sanitization above should work) |
if (strpos($lang,'\\') !== false) return $str; // prevent attack (but actually, the sanitization above should work) |
if (strpos($lang,'..') !== false) return $str; // prevent attack (but actually, the sanitization above should work) |
$translation_file = __DIR__.'/plugins/language/'.$lang.'/messages.xml'; |
if (!file_exists($translation_file)) continue; |
$xml = simplexml_load_string(file_get_contents($translation_file)); |
$xml = @simplexml_load_string(file_get_contents($translation_file)); |
if (!$xml) continue; // if there is an UTF-8 or parsing error, don't output any errors, otherwise the JavaScript is corrupt and the page won't render correctly |
foreach ($xml->message as $msg) { |
$src = $msg->source->__toString(); |
$dst = $msg->target->__toString(); |
$src = trim($msg->source->__toString()); |
$dst = trim($msg->target->__toString()); |
$translation_array[$lang][$src] = $dst; |
} |
|
} |
$files[]= 'var language_messages = '.json_encode($translation_array).';'; |
} |
|
//$tbl_prefix = OIDplus::baseConfig()->getValue('OIDPLUS_TABLENAME_PREFIX',''); |
//$files[] = 'var language_tblprefix = '.json_encode($tbl_prefix).';'; |
$files[] = 'var language_tblprefix = "<tableprefix>";'; // hide OIDPLUS_TABLENAME_PREFIX from the client |
|
# --- |
|
$minifier = null; |