From 3af2f7695baea8fff44455987d15f950217e4bc4 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 22 Nov 2019 14:13:20 +0100 Subject: lib/helper.php: use site_is_reachable() instead of copying code --- lib/helper.php | 5 ++--- 1 file 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); }; -- cgit v1.2.3