summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-11-22 14:13:20 +0100
committerErich Eckner <git@eckner.net>2019-11-22 14:13:20 +0100
commit3af2f7695baea8fff44455987d15f950217e4bc4 (patch)
tree4740c67981c9f10dfb3ec5b0d7d9e889fe85860d /lib
parentbf9d8b1e6cadf95b7c3ebc45767a55e6c197914f (diff)
downloadarchweb32-3af2f7695baea8fff44455987d15f950217e4bc4.tar.xz
lib/helper.php: use site_is_reachable() instead of copying code
Diffstat (limited to 'lib')
-rw-r--r--lib/helper.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/helper.php b/lib/helper.php
index debfb06..a81eedf 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -89,9 +89,8 @@ function git_url($repository,$type,$commit,$path,$line = null,$commit_is_hash =
$git_available = apcu_fetch('git_available', $apcu_success);
if ($apcu_success == false) {
$git_available =
- preg_match(
- "/ 200 OK$/",
- get_headers("https://git.archlinux32.org/packages")[0]
+ site_is_reachable(
+ 'https://git.archlinux32.org/packages'
);
apcu_store('git_available', $git_available, 120);
};