From 0ae733531624146025e9f772c0745c723e20a625 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 4 Sep 2013 12:07:26 -0700 Subject: [PATCH] Add missing (int) casts to Herald rule editing Summary: Fixes T3792. These raise errors if the database is in strict mode and you try to create an "any" rule. Test Plan: Created a rule with "any". Reviewers: btrahan, chad Reviewed By: chad CC: aran Maniphest Tasks: T3792 Differential Revision: https://secure.phabricator.com/D6883 --- src/applications/herald/controller/HeraldRuleController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php index 51edfa98d1..5db966c2eb 100644 --- a/src/applications/herald/controller/HeraldRuleController.php +++ b/src/applications/herald/controller/HeraldRuleController.php @@ -35,7 +35,7 @@ final class HeraldRuleController extends HeraldController { } else { $rule = new HeraldRule(); $rule->setAuthorPHID($user->getPHID()); - $rule->setMustMatchAll(true); + $rule->setMustMatchAll(1); $content_type = $request->getStr('content_type'); $rule->setContentType($content_type); @@ -206,7 +206,8 @@ final class HeraldRuleController extends HeraldController { private function saveRule(HeraldAdapter $adapter, $rule, $request) { $rule->setName($request->getStr('name')); - $rule->setMustMatchAll(($request->getStr('must_match') == 'all')); + $match_all = ($request->getStr('must_match') == 'all'); + $rule->setMustMatchAll((int)$match_all); $repetition_policy_param = $request->getStr('repetition_policy'); $rule->setRepetitionPolicy(