Removed unused "areyounew" language prompt from all languages and from
[lhc/web/wiklou.git] / wiki.phtml
index 215bb64..d30db09 100644 (file)
@@ -3,15 +3,15 @@
 #
 $wgRequestTime = microtime();
 
-session_cache_limiter( "private, must-revalidate" );
-session_start();
-session_register( "wsUserID" );
-session_register( "wsUserName" );
-session_register( "wsUserPassword" );
-
-global $IP;
+unset( $IP );
+ini_set( "allow_url_fopen", 0 ); # For security...
 include_once( "./LocalSettings.php" );
-include_once( "$IP/Setup.php" );
+
+# Windows requires ';' as separator, ':' for Unix
+$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
+ini_set( "include_path", "$IP$sep$include_path" );
+
+include_once( "Setup.php" );
 
 wfProfileIn( "main-misc-setup" );
 OutputPage::setEncodings(); # Not really used yet
@@ -23,6 +23,7 @@ $headers = getallheaders();
 foreach ($headers as $name => $value) {
        wfDebug( "$name: $value\n" );
 }
+wfDebug( "\n" );
 
 # Query string fields
 #
@@ -38,30 +39,31 @@ if ( "" == $title && "delete" != $action ) {
 } else {
        $wgTitle = Title::newFromURL( $title );
 #      if( $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" or strncmp($wgTitle->getDBkey(),"_",1) == 0 ) {
-       if( $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" ) {
+       if( !$wgTitle or $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" ) {
+               $wgTitle = Title::newFromText( wfMsg( "badtitle" ) );
                $wgOut->errorpage( "badtitle", "badtitletext" );
                $wgOut->output();
                exit;
        }
 }
-wfProfileOut();
-if ( -1 == $wgTitle->getNamespace() ) {
+wfProfileOut( "main-misc-setup" );
+
+if ( Namespace::getSpecial() == $wgTitle->getNamespace() ) {
        wfSpecialPage();
 } else if ( "" != $search ) {
        if($go) {
-       
-               wfGo ($search);
-       
+               wfGo( $search );
        } else {
-       
                wfSearch( $search );
-               
        }
-               
 } else {
+       if ( Namespace::getMedia() == $wgTitle->getNamespace() ) {
+               $wgTitle = Title::makeTitle( Namespace::getImage(), $wgTitle->getDBkey() );
+       }       
+       
        switch( $wgTitle->getNamespace() ) {
        case 6:
-               include_once( "$IP/ImagePage.php" );
+               include_once( "ImagePage.php" );
                $wgArticle = new ImagePage( $wgTitle );
                break;
        default:
@@ -85,7 +87,7 @@ if ( -1 == $wgTitle->getNamespace() ) {
                        break;
                case "edit":
                case "submit":
-                       include_once( "$IP/EditPage.php" );
+                       include_once( "EditPage.php" );
                        $editor = new EditPage( $wgArticle );
                        $editor->$action();
                        break;