Fixing bug in HTML diff when the word '0' is encountered. Thanks siebrand for reporting
[lhc/web/wiklou.git] / includes / Wiki.php
index fa49290..101ba7f 100644 (file)
@@ -60,6 +60,7 @@ class MediaWiki {
                        } elseif( is_string( $new_article ) ) {
                                $output->redirect( $new_article );
                        } else {
+                               wfProfileOut( __METHOD__ );
                                throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle() returned neither an object nor a URL" );
                        }
                }
@@ -251,12 +252,12 @@ class MediaWiki {
                }
 
                switch( $title->getNamespace() ) {
-               case NS_IMAGE:
-                       return new ImagePage( $title );
-               case NS_CATEGORY:
-                       return new CategoryPage( $title );
-               default:
-                       return new Article( $title );
+                       case NS_IMAGE:
+                               return new ImagePage( $title );
+                       case NS_CATEGORY:
+                               return new CategoryPage( $title );
+                       default:
+                               return new Article( $title );
                }
        }
 
@@ -274,8 +275,6 @@ class MediaWiki {
                $action = $this->getVal( 'action' );
                $article = self::articleFromTitle( $title );
                
-               wfDebug("Article: ".$title->getPrefixedText()."\n");
-               
                // Namespace might change when using redirects
                // Check for redirects ...
                $file = $title->getNamespace() == NS_IMAGE ? $article->getFile() : null;
@@ -457,21 +456,20 @@ class MediaWiki {
                                if( !$this->getVal( 'EnableDublinCoreRdf' ) ) {
                                        wfHttpError( 403, 'Forbidden', wfMsg( 'nodublincore' ) );
                                } else {
-                                       require_once( 'includes/Metadata.php' );
-                                       wfDublinCoreRdf( $article );
+                                       $rdf = new DublinCoreRdf( $article );
+                                       $rdf->show();
                                }
                                break;
                        case 'creativecommons':
                                if( !$this->getVal( 'EnableCreativeCommonsRdf' ) ) {
                                        wfHttpError( 403, 'Forbidden', wfMsg( 'nocreativecommons' ) );
                                } else {
-                                       require_once( 'includes/Metadata.php' );
-                                       wfCreativeCommonsRdf( $article );
+                                       $rdf = new CreativeCommonsRdf( $article );
+                                       $rdf->show();
                                }
                                break;
                        case 'credits':
-                               require_once( 'includes/Credits.php' );
-                               showCreditsPage( $article );
+                               Credits::showPage( $article );
                                break;
                        case 'submit':
                                if( session_id() == '' ) {