Killing double quotes
[lhc/web/wiklou.git] / index.php
index d623ae2..360f048 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,12 +3,15 @@
  * Main wiki script; see docs/design.txt
  * @package MediaWiki
  */
-
 $wgRequestTime = microtime();
 
 unset( $IP );
 @ini_set( 'allow_url_fopen', 0 ); # For security...
 
+if ( isset( $_REQUEST['GLOBALS'] ) ) {
+       die( '<a href="http://www.hardened-php.net/index.76.html">$GLOBALS overwrite vulnerability</a>');
+}
+
 # Valid web server entry point, enable includes.
 # Please don't move this line to includes/Defines.php. This line essentially defines
 # a valid entry point. If you put it in includes/Defines.php, then any script that includes
@@ -91,6 +94,13 @@ wfProfileOut( 'main-misc-setup' );
 # Debug statement for user levels
 // print_r($wgUser);
 
+$search = $wgRequest->getText( 'search' );
+if( !is_null( $search ) && $search !== '' ) {
+       // Compatibility with old search URLs which didn't use Special:Search
+       // Do this above the read whitelist check for security...
+       $wgTitle = Title::makeTitle( NS_SPECIAL, 'Search' );
+}
+
 # If the user is not logged in, the Namespace:title of the article must be in
 # the Read array in order for the user to see it. (We have to check here to
 # catch special pages etc. We check again in Article::view())
@@ -101,10 +111,6 @@ if ( !is_null( $wgTitle ) && !$wgTitle->userCanRead() ) {
 }
 
 wfProfileIn( 'main-action' );
-$search = $wgRequest->getText( 'search' );
-if( $wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) {
-       $wgTitle = Title::makeTitle( NS_SPECIAL, 'Search' );
-}
 
 if( !$wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) {
        require_once( 'includes/SpecialSearch.php' );
@@ -185,6 +191,7 @@ if( !$wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) {
                        case 'validate':
                        case 'render':
                        case 'deletetrackback':
+                       case 'purge':
                                $wgArticle->$action();
                                break;
                        case 'print':
@@ -246,12 +253,6 @@ if( !$wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) {
                                $raw = new RawPage( $wgArticle );
                                $raw->view();
                                break;
-                       case 'purge':
-                               wfPurgeSquidServers(array($wgTitle->getInternalURL()));
-                               $wgOut->setSquidMaxage( $wgSquidMaxage );
-                               $wgTitle->invalidateCache();
-                               $wgArticle->view();
-                               break;
                        default:
                                if (wfRunHooks('UnknownAction', array($action, $wgArticle))) {
                                        $wgOut->errorpage( 'nosuchaction', 'nosuchactiontext' );