wrap user css and js in pre on view
authorGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 29 Apr 2004 10:04:57 +0000 (10:04 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 29 Apr 2004 10:04:57 +0000 (10:04 +0000)
includes/Article.php

index 8b1d25b..55adf46 100644 (file)
@@ -127,6 +127,13 @@ 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;