From af71c990eee1754fcaf9f9fc0683a55f79c85194 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 10 Jul 2017 12:01:13 -0700 Subject: [PATCH] Test 0 and "" cases in Project Icon Config Summary: Better validation for setting a default image in project.icon Test Plan: Test adding `"0"` and `""` as image options in project.icon, see error. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18197 --- src/applications/project/icon/PhabricatorProjectIconSet.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/applications/project/icon/PhabricatorProjectIconSet.php b/src/applications/project/icon/PhabricatorProjectIconSet.php index f487b216f3..b128a35cad 100644 --- a/src/applications/project/icon/PhabricatorProjectIconSet.php +++ b/src/applications/project/icon/PhabricatorProjectIconSet.php @@ -262,7 +262,8 @@ final class PhabricatorProjectIconSet $is_disabled = idx($value, 'disabled'); - if (idx($value, 'image')) { + $image = idx($value, 'image'); + if ($image !== null) { $builtin = idx($value, 'image'); $builtin_map = id(new PhabricatorFilesOnDiskBuiltinFile()) ->getProjectBuiltinFiles();