r114054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114053‎ | r114054 | r114055 >
Date:14:26, 17 March 2012
Author:liangent
Status:ok
Tags:
Comment:
Use Http::get instead of file_get_contents to send proper User-Agent. Otherwise the request will be denied by WMF servers.
Modified paths:
  • /trunk/extensions/HelpCommons/HelpCommons.php (modified) (history)

Diff [purge]

Index: trunk/extensions/HelpCommons/HelpCommons.php
@@ -97,7 +97,7 @@
9898 }
9999
100100 // check if requested page does exist
101 - $apiResponse = file_get_contents( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $dbkey );
 101+ $apiResponse = Http::get( $url . $prefix . '/api.php?format=php&action=query&titles=Help:' . $dbkey );
102102 $apiData = unserialize( $apiResponse );
103103
104104 if ( !$apiResponse ) {

Sign-offs

UserFlagDate
Nikerabbitinspected07:29, 19 March 2012

Follow-up revisions

RevisionCommit summaryAuthorDate
r114055Followup-To: r114054: More to comesaper15:12, 17 March 2012

Status & tagging log