diff --git a/module/story/model.php b/module/story/model.php index e0f14160fc..67e0d4c329 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3082,7 +3082,7 @@ class storyModel extends model } elseif($branch !== 'all' and $branch !== '' and strpos($storyQuery, '`branch` =') === false and $queryProductID != 'all') { - $storyQuery .= " AND `branch` in($branch)"; + if($branch and strpos($storyQuery, '`branch` =') === false) $storyQuery .= " AND `branch` " . helper::dbIN($branch); } $storyQuery = preg_replace("/`plan` +LIKE +'%([0-9]+)%'/i", "CONCAT(',', `plan`, ',') LIKE '%,$1,%'", $storyQuery);