Rev 310 | Rev 360 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 310 | Rev 355 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | foreach ($manifest->getJSFiles() as $js_file) { |
45 | foreach ($manifest->getJSFiles() as $js_file) { |
46 | $files[] = $js_file; |
46 | $files[] = $js_file; |
47 | } |
47 | } |
48 | } |
48 | } |
49 | 49 | ||
- | 50 | foreach (OIDplus::getAllPluginManifests('language') as $pluginManifest) { |
|
- | 51 | $xmldata = $pluginManifest->getRawXml(); |
|
- | 52 | $lang = $xmldata->language->code->__toString(); |
|
- | 53 | if (strpos($lang,'/') !== false) return $str; // prevent attack (but actually, the sanitization above should work) |
|
- | 54 | if (strpos($lang,'\\') !== false) return $str; // prevent attack (but actually, the sanitization above should work) |
|
- | 55 | if (strpos($lang,'..') !== false) return $str; // prevent attack (but actually, the sanitization above should work) |
|
- | 56 | $translation_file = __DIR__.'/plugins/language/'.$lang.'/messages.xml'; |
|
- | 57 | if (!file_exists($translation_file)) continue; |
|
- | 58 | $xml = simplexml_load_string(file_get_contents($translation_file)); |
|
- | 59 | foreach ($xml->message as $msg) { |
|
- | 60 | $src = $msg->source->__toString(); |
|
- | 61 | $dst = $msg->target->__toString(); |
|
- | 62 | $translation_array[$lang][$src] = $dst; |
|
- | 63 | } |
|
- | 64 | ||
- | 65 | $files[]= 'var language_messages = '.json_encode($translation_array).';'; |
|
- | 66 | } |
|
- | 67 | ||
50 | # --- |
68 | # --- |
51 | 69 | ||
52 | $minifier = null; |
70 | $minifier = null; |
53 | $out = ''; |
71 | $out = ''; |
54 | 72 |