]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for MDL-8507 "Local language pack-name can appear in language code"
authornfreear <nfreear>
Tue, 13 Feb 2007 13:38:53 +0000 (13:38 +0000)
committernfreear <nfreear>
Tue, 13 Feb 2007 13:38:53 +0000 (13:38 +0000)
lib/weblib.php

index a8a2f832fa49e6c0b100966afc2ac26800ec5b22..6f28d620a29c261470cb1026dc0586765439fa4a 100644 (file)
@@ -2059,7 +2059,7 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
         $direction = ' dir="ltr"';
     }
     //Accessibility: added the 'lang' attribute to $direction, used in theme <html> tag.
-    $language = str_replace('_utf8','',$CFG->lang);
+    $language = str_replace('_', '-', str_replace('_utf8', '', current_language()));
     $direction .= ' lang="'.$language.'" xml:lang="'.$language.'"';
 
     if ($cache) {  // Allow caching on "back" (but not on normal clicks)