Put the suppress & restore warnings calls *around* parse_url() rather than around...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Jan 2008 23:44:26 +0000 (23:44 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Jan 2008 23:44:26 +0000 (23:44 +0000)
This avoids PHP warning notices when given not-quite-valid input, such as "http://en.wikipedia.org{{localurl:Talk:Wet_Tropics_of_Queensland/Comments|action=edit}}"

includes/GlobalFunctions.php

index 7237d74..3b19ae4 100644 (file)
@@ -1946,8 +1946,8 @@ function wfRelativePath( $path, $from ) {
  */
 function wfMakeUrlIndex( $url ) {
        global $wgUrlProtocols; // Allow all protocols defined in DefaultSettings/LocalSettings.php
-       $bits = parse_url( $url );
        wfSuppressWarnings();
+       $bits = parse_url( $url );
        wfRestoreWarnings();
        if ( !$bits ) {
                return false;