From: Reedy Date: Sat, 28 Jul 2012 18:50:34 +0000 (+0100) Subject: Suppress warnings around parse_url call X-Git-Tag: 1.31.0-rc.0~22928 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=c61744b0d8f0fb654dacbaed8f4b31adc6d346c3;p=lhc%2Fweb%2Fwiklou.git Suppress warnings around parse_url call From the docs: On seriously malformed URLs, parse_url may return false and emit a E_WARNING We're already checking for false, but we can get spammed with E_WARNING.. Change-Id: I44a9ef2b163e64113bd2a30b081c1256ffeada1e --- diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 766db461c2..91bd9237f1 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -88,7 +88,9 @@ class WebRequest { if ( !preg_match( '!^https?://!', $url ) ) { $url = 'http://unused' . $url; } + wfSuppressWarnings(); $a = parse_url( $url ); + wfRestoreWarnings(); if( $a ) { $path = isset( $a['path'] ) ? $a['path'] : '';