]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15688: readability improvement to the script
authorscyrma <scyrma>
Wed, 30 Jul 2008 10:19:35 +0000 (10:19 +0000)
committerscyrma <scyrma>
Wed, 30 Jul 2008 10:19:35 +0000 (10:19 +0000)
lib/editor/tinymce/create_langfiles.php

index 04b667f740be22bc12c9ccf6c6e8f37a55e780b7..600f29b502cc4a699196a2c2e4dc7f1cabafe619 100755 (executable)
@@ -71,7 +71,7 @@ function write_language_file($lang, $langdata) {
     fwrite($file, "/* this file was automatically imported from TinyMCE's translations */\n");
     foreach($langdata as $id => $line) {
         // the next two lines are there to make you enjoy how php deals with backslashes
-        $line = preg_replace_callback('/\\\\u([\dABCDEF]{4})/', 'unichr', $line); // we're matching something like \u00E9
+        $line = preg_replace_callback('/\\\\u([0-9A-F]{4})/', 'unichr', $line); // we're matching something like \u00E9
         // we're only escaping single quotes, but we gotta prevent escaping those that have already been escaped.
         fwrite($file, '$string[\''. $id ."']='". strtr($line, array('\\\'' => '\\\'', '\'' => '\\\'')) ."';\n"); 
     }