generate_lang_file.php : fix to handle double-quotes in PHP output
authorBenjamin Renard <brenard@easter-eggs.com>
Thu, 28 Jan 2016 17:10:08 +0000 (18:10 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Thu, 28 Jan 2016 17:10:08 +0000 (18:10 +0100)
public_html/lang/generate_lang_file.php

index 1b2d30c..e9aa9a7 100755 (executable)
@@ -318,6 +318,8 @@ foreach($data as $key => $val) {
   if ($copyoriginalvalue && $val=="") {
     $val=$key;
   }
   if ($copyoriginalvalue && $val=="") {
     $val=$key;
   }
+  $key=str_replace('"','\\"',$key);
+  $val=str_replace('"','\\"',$val);
   if ($additionalfileformat) {
     print "\$GLOBALS['LSlang'][\"$key\"] = \"$val\";\n";
   }
   if ($additionalfileformat) {
     print "\$GLOBALS['LSlang'][\"$key\"] = \"$val\";\n";
   }