From c4896c7791cd76dd9905ad8ee64cb3ca2b340d1f Mon Sep 17 00:00:00 2001 From: Yardena Cohen Date: Sat, 27 Oct 2018 01:53:45 -0700 Subject: [PATCH] [Configuration] Fix open_basedir warnings (#887) If .git/HEAD isn't in open_basedir it'd throw ugly warnings. Suppress errors while checking if file is readable --- lib/Configuration.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Configuration.php b/lib/Configuration.php index 04e2c4b5..b76744f5 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -107,7 +107,8 @@ class Configuration { $headFile = '.git/HEAD'; - if(file_exists($headFile)) { + // '@' is used to mute open_basedir warning + if(@is_readable($headFile)) { $revisionHashFile = '.git/' . substr(file_get_contents($headFile), 5, -1); $branchName = explode('/', $revisionHashFile)[3];