From f2aab0260b3eb57af577061ae5706ca68ba00e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 16 Apr 2012 14:30:56 +0200 Subject: [PATCH] Check whether file exists before trying to read it .git/objects/* do not have to exist at all if object data is present in pack --- libraries/Config.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/Config.class.php b/libraries/Config.class.php index bed4d32830..9875ff1975 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -406,9 +406,12 @@ class PMA_Config } if ( !isset($_SESSION['PMA_VERSION_COMMITDATA_' . $hash])) { - if (! $commit = @file_get_contents( - $git_folder . '/objects/' . substr($hash, 0, 2) - . '/' . substr($hash, 2))) { + $git_file_name = $git_folder . '/objects/' . substr($hash, 0, 2) + . '/' . substr($hash, 2); + if (! file_exists($git_file_name) ) { + return; + } + if (! $commit = @file_get_contents($git_file_name)) { return; } $commit = explode("\0", gzuncompress($commit), 2);