From: Platonides Date: Sun, 7 Feb 2010 16:26:17 +0000 (+0000) Subject: Fix at least the url and entities. X-Git-Tag: 1.31.0-rc.0~37892 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=1a579b23a22489a9a9a3943a36c410d42513d51f;p=lhc%2Fweb%2Fwiklou.git Fix at least the url and entities. --- diff --git a/maintenance/importImages.inc b/maintenance/importImages.inc index 61baf7c415..0f335ee277 100644 --- a/maintenance/importImages.inc +++ b/maintenance/importImages.inc @@ -91,22 +91,22 @@ 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:' . $file . '&prop=imageinfo&&iiprop=comment'; + $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment'; $body = file_get_contents($url); if (preg_match('##', $body, $matches) == 0) { return false; } - return $matches[1]; + return html_entity_decode( $matches[1] ); } function getFileUserFromSourceWiki($wiki_host, $file) { - $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . $file . '&prop=imageinfo&&iiprop=user'; + $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user'; $body = file_get_contents($url); if (preg_match('##', $body, $matches) == 0) { return false; } - return $matches[1]; + return html_entity_decode( $matches[1] ); }