]> git.mjollnir.org Git - moodle.git/commitdiff
Now encoding some fields to be non-ASCII aware. Thanks to Petr Skoda.
authorstronk7 <stronk7>
Sat, 24 Apr 2004 00:48:57 +0000 (00:48 +0000)
committerstronk7 <stronk7>
Sat, 24 Apr 2004 00:48:57 +0000 (00:48 +0000)
See bug 1266 (http://moodle.org/bugs/bug.php?op=show&bugid=1266&pos=14).
Applied the same patch to alias too!!

mod/glossary/import.php

index a273d945795381eac5db29027225b97c97ee4661..717e7e9e961ae99d3ec808cb8dd16e2e8d83857f 100644 (file)
                         unset($newalias);
         
                         $newalias->entryid = $newentry->id;
-                        $newalias->alias = $xmlalias['#']['NAME'][0]['#'];
+                        $newalias->alias = addslashes(utf8_decode($xmlalias['#']['NAME'][0]['#']));
                         $newalias->id = insert_record("glossary_alias",$newalias);
                     }
 
                             $xmlcat = $xmlcats[$k];
                             unset($newcat);
         
-                            $newcat->name = $xmlcat['#']['NAME'][0]['#'];
+                            $newcat->name = addslashes(utf8_decode($xmlcat['#']['NAME'][0]['#']));
                             $newcat->usedynalink = $xmlcat['#']['USEDYNALINK'][0]['#'];
                             if ( !$category = get_record("glossary_categories","glossaryid",$glossary->id,"name",$newcat->name) ) {
                                 // Create the category if it does not exist
 /// Finish the page
     print_footer($course);
 
-?>
\ No newline at end of file
+?>