From 3bf106dc3ce4d10430d682e4bae20d2b65feb9b6 Mon Sep 17 00:00:00 2001 From: bergware Date: Mon, 30 Mar 2020 23:45:38 +0200 Subject: [PATCH] Multi-language support --- plugins/dynamix/include/Translations.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/plugins/dynamix/include/Translations.php b/plugins/dynamix/include/Translations.php index dfa8f869b..61bc7f985 100644 --- a/plugins/dynamix/include/Translations.php +++ b/plugins/dynamix/include/Translations.php @@ -21,7 +21,7 @@ function _($text) { return strpos($data,'*')===false ? $data : preg_replace(['/\*\*(.+?)\*\*/','/\*(.+?)\*/'],['$1','$1'],$data); } function parse_lang_file($file) { - return languageSecurity(array_filter(parse_ini_string(preg_replace(['/"/m','/^(null|yes|no|true|false|on|off|none)=/mi','/^([^>].*)=([^"\'`].*)$/m','/^:((help|plug)\d*)$/m','/^:end$/m'],['\'','$1.=','$1="$2"',"_$1_=\"",'"'],str_replace("=\n","=''\n",file_get_contents($file)))),'strlen')); + return array_filter(parse_ini_string(preg_replace(['/^(null|yes|no|true|false|on|off|none)=/mi','/^([^>].*)=([^"\'`].*)$/m','/^:((help|plug)\d*)$/m','/^:end$/m'],['$1.=','$1="$2"',"_$1_=\"",'"'],str_replace(['"',"'","=\n"],[""","'","=''\n"],file_get_contents($file)))),'strlen'); } function parse_text($text) { return preg_replace_callback('/_\((.+?)\)_/m',function($m){return _($m[1]);},preg_replace(["/^:((help|plug)\d*)$/m","/^:end$/m"],["",""],$text)); @@ -57,16 +57,6 @@ function my_lang($text,$do=0) { } return $text; } - -function languageSecurity($languageArray) { - foreach ($languageArray as &$translation) { - $tempElement = html_entity_decode($translation); - if ( preg_match('#(.*?)#is',$tempElement) || preg_match('#(.*?)#is',$tempElement) || (stripos($tempElement,"'.Markdown($language[$key]));