From: Joshua Spence Date: Tue, 24 Jun 2014 01:40:04 +0000 (+1000) Subject: Pass the file contents instead of the file path to `phutil_json_decode`. X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=108a4dc9e6ca9de9b6faab9ba5cd0168324be0be;p=arcanist.git Pass the file contents instead of the file path to `phutil_json_decode`. Summary: See D9681#22. Test Plan: Created an empty `.git/arc/config` file... no exception was thrown. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D9704 --- diff --git a/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php b/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php index 700b6d6c..289f11a4 100644 --- a/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php +++ b/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php @@ -311,7 +311,8 @@ final class ArcanistWorkingCopyIdentity { $local_path)); try { - return phutil_json_decode($local_path); + $json = Filesystem::readFile($local_path); + return phutil_json_decode($json); } catch (PhutilJSONParserException $ex) { throw new PhutilProxyException( pht("Failed to parse '%s' as JSON.", $local_path),