https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114054

Revision: 114054
Author:   liangent
Date:     2012-03-17 14:26:18 +0000 (Sat, 17 Mar 2012)
Log Message:
-----------
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: trunk/extensions/HelpCommons/HelpCommons.php
===================================================================
--- trunk/extensions/HelpCommons/HelpCommons.php        2012-03-17 11:05:04 UTC 
(rev 114053)
+++ trunk/extensions/HelpCommons/HelpCommons.php        2012-03-17 14:26:18 UTC 
(rev 114054)
@@ -97,7 +97,7 @@
                                                }
 
                                                // check if requested page does 
exist
-                                               $apiResponse = 
file_get_contents( $url . $prefix . 
'/api.php?format=php&action=query&titles=Help:' . $dbkey );
+                                               $apiResponse = Http::get( $url 
. $prefix . '/api.php?format=php&action=query&titles=Help:' . $dbkey );
                                                $apiData = unserialize( 
$apiResponse );
 
                                                if ( !$apiResponse ) {


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to