r50711 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50710‎ | r50711 | r50712 >
Date:00:48, 18 May 2009
Author:demon
Status:ok
Tags:
Comment:
Remove getHttp() method and just call Http::get() directly.
Modified paths:
  • /trunk/extensions/SpamBlacklist/SpamBlacklist_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php
@@ -161,7 +161,7 @@
162162
163163 if ( !is_string( $httpText ) || ( !$warning && !mt_rand( 0, $this->warningChance ) ) ) {
164164 wfDebugLog( 'SpamBlacklist', "Loading spam blacklist from $fileName\n" );
165 - $httpText = $this->getHTTP( $fileName );
 165+ $httpText = Http::get( $fileName );
166166 if( $httpText === false ) {
167167 wfDebugLog( 'SpamBlacklist', "Error loading blacklist from $fileName\n" );
168168 }
@@ -324,22 +324,6 @@
325325 return strval( $text );
326326 }
327327
328 - function getHTTP( $url ) {
329 - // Use wfGetHTTP from MW 1.5 if it is available
330 - global $IP;
331 - include_once( "$IP/includes/HttpFunctions.php" );
332 - wfSuppressWarnings();
333 - if ( function_exists( 'wfGetHTTP' ) ) {
334 - $text = wfGetHTTP( $url );
335 - } else {
336 - $url_fopen = ini_set( 'allow_url_fopen', 1 );
337 - $text = file_get_contents( $url );
338 - ini_set( 'allow_url_fopen', $url_fopen );
339 - }
340 - wfRestoreWarnings();
341 - return $text;
342 - }
343 -
344328 /**
345329 * Confirm that a local blacklist page being saved is valid,
346330 * and toss back a warning to the user if it isn't.

Status & tagging log