Browse Source

Fixed long-standing sub-language issue generating parse errors - refs #6773

Yannick Warnier 11 years ago
parent
commit
ea6c085f1b
1 changed files with 3 additions and 0 deletions
  1. 3 0
      main/admin/sub_language_ajax.inc.php

+ 3 - 0
main/admin/sub_language_ajax.inc.php

@@ -31,7 +31,10 @@ if (isset($new_language) && isset($language_variable) && isset($file_id)) {
     $return_value            = SubLanguageManager::add_file_in_language_directory($path_folder);
 
     //update variable language
+    // Replace double quotes to avoid parse errors
     $new_language = str_replace('"', '\"',$new_language);
+    // Replace new line signs to avoid parse errors - see #6773
+    $new_language = str_replace("\n","\\n",$new_language);
     $all_file_of_directory[$language_variable]="\"".api_convert_encoding($new_language, api_get_system_encoding(),'UTF-8')."\";";
     $result_array = array();