From c61744b0d8f0fb654dacbaed8f4b31adc6d346c3 Mon Sep 17 00:00:00 2001 From: Reedy Date: Sat, 28 Jul 2012 19:50:34 +0100 Subject: [PATCH] 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 --- includes/WebRequest.php | 2 ++ 1 file changed, 2 insertions(+) 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'] : ''; -- 2.20.1