moved the css special case to view(), old versions had the \<pre\> in them
authorGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 29 Apr 2004 23:13:19 +0000 (23:13 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 29 Apr 2004 23:13:19 +0000 (23:13 +0000)
includes/Article.php

index 55adf46..f9d076d 100644 (file)
@@ -127,13 +127,6 @@ class Article {
                                                wfProfileOut( $fname );
                                                return $rv;
                                        }
-                               } else if ( 
-                                       # wrap user css and user js in pre
-                                       $this->mTitle->getNamespace() == Namespace::getUser() && 
-                                       preg_match("/\\/[\\w]+\\.(css|js)$/", $this->mTitle->getDBkey())
-                               ) 
-                               {
-                                       $this->mContent = '<pre>'.htmlspecialchars($this->mContent)."\n</pre>";
                                }
                                wfProfileOut( $fname );
                                return $this->mContent;
@@ -508,8 +501,14 @@ class Article {
                }
 
                $wgLinkCache->preFill( $this->mTitle );
-               
-               if( $wgEnableParserCache && intval($wgUser->getOption( "stubthreshold" )) == 0 ){
+
+               # wrap user css and user js in pre and don't parse
+               if ( 
+                       $this->mTitle->getNamespace() == Namespace::getUser() && 
+                       preg_match("/\\/[\\w]+\\.(css|js)$/", $this->mTitle->getDBkey())
+               ) {
+                       $wgOut->addHTML( '<pre>'.htmlspecialchars($this->mContent)."\n</pre>" );
+               } else if( $wgEnableParserCache && intval($wgUser->getOption( "stubthreshold" )) == 0 ){
                        $wgOut->addWikiText( $text, true, $this );
                } else {
                        $wgOut->addWikiText( $text );