From 551012739b75432a484ff5b245cb39acb8ae21a8 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 10 Dec 2018 11:31:21 +0100 Subject: packages/pkginfo.php: $skip_json_checks was not initialized properly --- packages/pkginfo.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'packages/pkginfo.php') 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( -- cgit v1.2.3-70-g09d2