summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GentooPackages/GentooPackages.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/GentooPackages/GentooPackages.php b/GentooPackages/GentooPackages.php
index 3f38dd46..fe73bda4 100644
--- a/GentooPackages/GentooPackages.php
+++ b/GentooPackages/GentooPackages.php
@@ -13,7 +13,11 @@ class GentooPackages {
}
static function fetchOrError($atom, $type) {
- $json_str = Http::get("https://packages.gentoo.org/packages/${atom}.json");
+ global $wgVersion;
+ if(version_compare( $wgVersion, '1.33', '<=' ))
+ $json_str = Http::get("https://packages.gentoo.org/packages/${atom}.json");
+ else
+ $json_str = \MediaWiki\Http\HttpRequestFactory::get("https://packages.gentoo.org/packages/${atom}.json");
if ($json_str === false) {
return '<div class="alert alert-danger">Cannot load package information. Is the atom <em>' . htmlspecialchars($atom) . '</em> correct?</div>';