And an erroneous )
[lhc/web/wiklou.git] / includes / OutputPage.php
index 0bc1bd7..0677495 100644 (file)
@@ -186,12 +186,12 @@ class OutputPage {
         */
        public function addScriptFile( $file ) {
                global $wgStylePath, $wgStyleVersion;
-               if( substr( $file, 0, 1 ) == '/' ) {
+               if( substr( $file, 0, 1 ) == '/' || substr( $file, 0, 7 ) == 'http://' ) {
                        $path = $file;
                } else {
                        $path =  "{$wgStylePath}/common/{$file}";
                }
-               $this->addScript( Html::linkedScript( "$path?$wgStyleVersion" ) );
+               $this->addScript( Html::linkedScript( wfAppendQuery( $path, $wgStyleVersion ) ) );
        }
 
        /**
@@ -257,7 +257,7 @@ class OutputPage {
        /**
         * Set whether the output should only contain the body of the article,
         * without any skin, sidebar, etc.
-        * Used e.g. when calling with "action=raw".
+        * Used e.g. when calling with "action=render".
         *
         * @param $only Boolean: whether to output only the body of the article
         */
@@ -451,10 +451,10 @@ class OutputPage {
        }
 
        /**
-        * "Page title" means the contents of <h1>. It is stored as a valid HTML fragment.
-        * This function allows good tags like <sup> in the <h1> tag, but not bad tags like <script>.
-        * This function automatically sets <title> to the same content as <h1> but with all tags removed.
-        * Bad tags that were escaped in <h1> will still be escaped in <title>, and good tags like <i> will be dropped entirely.
+        * "Page title" means the contents of \<h1\>. It is stored as a valid HTML fragment.
+        * This function allows good tags like \<sup\> in the \<h1\> tag, but not bad tags like \<script\>.
+        * This function automatically sets \<title\> to the same content as \<h1\> but with all tags removed.
+        * Bad tags that were escaped in \<h1\> will still be escaped in \<title\>, and good tags like \<i\> will be dropped entirely.
         */
        public function setPageTitle( $name ) {
                # change "<script>foo&bar</script>" to "&lt;script&gt;foo&amp;bar&lt;/script&gt;"
@@ -472,7 +472,7 @@ class OutputPage {
        }
 
        /**
-        * Return the "page title", i.e. the content of the <h1> tag.
+        * Return the "page title", i.e. the content of the \<h1\> tag.
         *
         * @return String
         */
@@ -1401,7 +1401,6 @@ class OutputPage {
                        $response->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
                        $response->header( 'Pragma: no-cache' );
                }
-               wfRunHooks('CacheHeadersAfterSet', array( $this ) );
        }
 
        /**
@@ -2105,8 +2104,8 @@ class OutputPage {
                                # Much saner.
                                $ret .= "<!doctype html>\n";
                        }
-                       $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\" ";
-                       if ( $wgHtml5Version ) $ret .= " version=\"$wgHtml5Version\" ";
+                       $ret .= "<html lang=\"$wgContLanguageCode\" dir=\"$dir\"";
+                       if ( $wgHtml5Version ) $ret .= " version=\"$wgHtml5Version\"";
                        $ret .= ">\n";
                } else {
                        $ret .= "<!DOCTYPE html PUBLIC \"$wgDocType\" \"$wgDTD\">\n";
@@ -2114,7 +2113,7 @@ class OutputPage {
                        foreach($wgXhtmlNamespaces as $tag => $ns) {
                                $ret .= "xmlns:{$tag}=\"{$ns}\" ";
                        }
-                       $ret .= "xml:lang=\"$wgContLanguageCode\" lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
+                       $ret .= "lang=\"$wgContLanguageCode\" dir=\"$dir\">\n";
                }
 
                $ret .= "<head>\n";
@@ -2583,14 +2582,14 @@ class OutputPage {
         * @return Array: the list of modules which were not loaded.
         */
        public function includeJQuery( $modules = array() ) {
-               global $wgScriptPath, $wgStyleVersion, $wgJsMimeType;
+               global $wgStylePath, $wgStyleVersion, $wgJsMimeType;
 
                $supportedModules = array( /** TODO: add things here */ );
                $unsupported = array_diff( $modules, $supportedModules );
 
                $params = array(
                        'type' => $wgJsMimeType,
-                       'src' => "$wgScriptPath/skins/common/jquery.min.js?$wgStyleVersion",
+                       'src' => "$wgStylePath/common/jquery.min.js?$wgStyleVersion",
                );
                if ( !$this->mJQueryDone ) {
                        $this->mJQueryDone = true;