file_get_contents -> Http::get per ^demon
authorPlatonides <platonides@users.mediawiki.org>
Sun, 7 Feb 2010 18:39:26 +0000 (18:39 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sun, 7 Feb 2010 18:39:26 +0000 (18:39 +0000)
maintenance/importImages.inc

index 0f335ee..7bb50eb 100644 (file)
@@ -92,7 +92,7 @@ function findAuxFile( $file, $auxExtension, $maxStrip = 1 ) {
 # FIXME: Access the api in a saner way and performing just one query (preferably batching files too).
 function getFileCommentFromSourceWiki($wiki_host, $file) {
     $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment';
-    $body = file_get_contents($url);
+    $body = Http::get($url);
     if (preg_match('#<ii comment="([^"]*)" />#', $body, $matches) == 0) {
         return false;
     }
@@ -102,7 +102,7 @@ function getFileCommentFromSourceWiki($wiki_host, $file) {
 
 function getFileUserFromSourceWiki($wiki_host, $file) {
     $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user';
-    $body = file_get_contents($url);
+    $body = Http::get($url);
     if (preg_match('#<ii user="([^"]*)" />#', $body, $matches) == 0) {
         return false;
     }