Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-12-10 11:31:21 +0100
committerErich Eckner <git@eckner.net>2018-12-10 11:31:21 +0100
commit551012739b75432a484ff5b245cb39acb8ae21a8 (patch)
tree7f14cd9bb877a775a3e320d3ac7cf6d3b2ccd34c
parentdce8523c52ce1f8e5b4f9799827ed1f5c60a8a55 (diff)
packages/pkginfo.php: $skip_json_checks was not initialized properly
-rw-r--r--packages/pkginfo.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/packages/pkginfo.php b/packages/pkginfo.php
index d6d04fb..fb1b94f 100644
--- a/packages/pkginfo.php
+++ b/packages/pkginfo.php
@@ -5,25 +5,25 @@ require_once BASE . "/lib/helper.php";
require_once BASE . "/lib/mysql.php";
require_once BASE . "/lib/style.php";
- if (!$skip_json_checks) {
- $memcache = new Memcache;
- $memcache -> connect('localhost', 11211) or die ('Memcached Connection Error');
- $pkgapi_reachable = $memcache -> get('pkgapi_reachable');
- $tld = array_pop((explode('.', $_SERVER['HTTP_HOST'])));
- if (array_key_exists('HTTPS', $_SERVER) && ($_SERVER['HTTPS'] == 'on'))
- $protocol = 'https';
+ $memcache = new Memcache;
+ $memcache -> connect('localhost', 11211) or die ('Memcached Connection Error');
+ $pkgapi_reachable = $memcache -> get('pkgapi_reachable');
+ $tld = array_pop((explode('.', $_SERVER['HTTP_HOST'])));
+ if (array_key_exists('HTTPS', $_SERVER) && ($_SERVER['HTTPS'] == 'on'))
+ $protocol = 'https';
+ else
+ $protocol = 'http';
+ if ($pkgapi_reachable === false) {
+ if (site_is_reachable($protocol . '://pkgapi.archlinux32.' . $tld . '/'))
+ $pkgapi_reachable = 'YES';
else
- $protocol = 'http';
- if ($pkgapi_reachable === false) {
- if (site_is_reachable($protocol . '://pkgapi.archlinux32.' . $tld . '/'))
- $pkgapi_reachable = 'YES';
- else
- $pkgapi_reachable = 'NO';
- $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300);
- }
- if ($pkgapi_reachable == 'NO')
- $skip_json_checks = true;
+ $pkgapi_reachable = 'NO';
+ $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300);
}
+ if ($pkgapi_reachable == 'YES')
+ $skip_json_checks = false;
+ else
+ $skip_json_checks = true;
if (!$skip_json_checks) {
$json_content = json_decode(