From 4f869815f3e45644655c2e236d1b4f797e87c68d Mon Sep 17 00:00:00 2001 From: Rob Thorne Date: Mon, 30 Nov 2015 11:04:45 -0800 Subject: [PATCH] Issue #2625986: enforce type string for plugin IDs. --- src/Engine/ExpressionManager.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Engine/ExpressionManager.php b/src/Engine/ExpressionManager.php index 9f25e2e2..a2c47266 100644 --- a/src/Engine/ExpressionManager.php +++ b/src/Engine/ExpressionManager.php @@ -50,6 +50,9 @@ public function createReactionRule(array $configuration = []) { * {@inheritdoc} */ public function createAction($id) { + if (!is_string($id)) { + throw new \InvalidArgumentException(t('Rules Action IDs must be strings.')); + } return $this->createInstance('rules_action', [ 'action_id' => $id, ]); @@ -59,6 +62,9 @@ public function createAction($id) { * {@inheritdoc} */ public function createCondition($id) { + if (!is_string($id)) { + throw new \InvalidArgumentException(t('Condition IDs must be strings.')); + } return $this->createInstance('rules_condition', [ 'condition_id' => $id, ]);