Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 354 → Rev 355

/trunk/oidplus.min.js.php
47,6 → 47,24
}
}
 
foreach (OIDplus::getAllPluginManifests('language') as $pluginManifest) {
$xmldata = $pluginManifest->getRawXml();
$lang = $xmldata->language->code->__toString();
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));
foreach ($xml->message as $msg) {
$src = $msg->source->__toString();
$dst = $msg->target->__toString();
$translation_array[$lang][$src] = $dst;
}
 
$files[]= 'var language_messages = '.json_encode($translation_array).';';
}
 
# ---
 
$minifier = null;