]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21196 workaround for xhtml strict problems in phploader
authorPetr Skoda <skodak@moodle.org>
Sun, 27 Dec 2009 09:27:41 +0000 (09:27 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 27 Dec 2009 09:27:41 +0000 (09:27 +0000)
lib/ajax/ajaxlib.php

index 39dfde4398b7ce43936db13b05b517013ec8f281..5cf751db79b53a52f1416664a49c7c829b899d4a 100644 (file)
@@ -478,7 +478,11 @@ class page_requirements_manager {
      * @return string
      */
     protected function get_yui3lib_headcode() {
-        return $this->yui3loader->css() . $this->yui3loader->script();
+        $code = $this->yui3loader->css() . $this->yui3loader->script();
+        // unfortunately yui loader does not produce xhtml strict code, so let's fix it for now
+        $code = str_replace('&amp;', '&', $code);
+        $code = str_replace('&', '&amp;', $code);
+        return $code;
     }
 
     /**
@@ -490,10 +494,13 @@ class page_requirements_manager {
     public function get_yui2lib_code() {
         // All YUI2 CSS is loaded automatically
         if ($this->headdone) {
-            return $this->yui2loader->script_embed();
+            $code = $this->yui2loader->script_embed();
         } else {
-            return $this->yui2loader->script();
+            $code = $this->yui2loader->script();
         }
+        $code = str_replace('&amp;', '&', $code);
+        $code = str_replace('&', '&amp;', $code);
+        return $code;
     }
 
     /**