r37066 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37065‎ | r37066 | r37067 >
Date:20:55, 4 July 2008
Author:brion
Status:old
Tags:
Comment:
Partial revert of r37016 (attempt to swap out old compat wfGetHTTP() with Http::get())
function_exists( 'Http::get' ) always returns false, since that's not a function name.
If the current state of the extension only works on modern versions of MW, then just call Http::get() without checking. If it still works on versions that predate it, it's best to keep the existing compat code probably.
Modified paths:
  • /trunk/extensions/SpamBlacklist/SpamBlacklist_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php
@@ -330,9 +330,12 @@
331331 }
332332
333333 function getHTTP( $url ) {
 334+ // Use wfGetHTTP from MW 1.5 if it is available
 335+ global $IP;
 336+ include_once( "$IP/includes/HttpFunctions.php" );
334337 wfSuppressWarnings();
335 - if ( function_exists( 'Http::get' ) ) {
336 - $text = Http::get( $url );
 338+ if ( function_exists( 'wfGetHTTP' ) ) {
 339+ $text = wfGetHTTP( $url );
337340 } else {
338341 $url_fopen = ini_set( 'allow_url_fopen', 1 );
339342 $text = file_get_contents( $url );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37016Use Http::get() rather than wfGetHttp() [which is otherwise unused and could ...demon02:22, 4 July 2008

Status & tagging log