From c4792df0bf1302160a7608c04d351814b0272c0e Mon Sep 17 00:00:00 2001
From: nfreear <nfreear>
Date: Tue, 13 Feb 2007 13:38:53 +0000
Subject: [PATCH] Fix for MDL-8507 "Local language pack-name can appear in
 language code"

---
 lib/weblib.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/weblib.php b/lib/weblib.php
index a8a2f832fa..6f28d620a2 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -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)
-- 
2.39.5