From: Brion Vibber Date: Wed, 30 Jan 2008 23:44:26 +0000 (+0000) Subject: Put the suppress & restore warnings calls *around* parse_url() rather than around... X-Git-Tag: 1.31.0-rc.0~49690 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=492d502295d7367fe61c4b00f58d5cfb542f0954;p=lhc%2Fweb%2Fwiklou.git Put the suppress & restore warnings calls *around* parse_url() rather than around an empty space after it. :) 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}}" --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 7237d74584..3b19ae4442 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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;