From 5e79c309742103399c9351735fa2b99f829c78f4 Mon Sep 17 00:00:00 2001 From: iglocska Date: Fri, 4 Dec 2015 14:28:02 +0100 Subject: [PATCH] Fix to the previous fix - Flipped it the wrong way, fixed now --- app/Controller/AttributesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Controller/AttributesController.php b/app/Controller/AttributesController.php index 0aed95a99..35f11ee20 100755 --- a/app/Controller/AttributesController.php +++ b/app/Controller/AttributesController.php @@ -2247,9 +2247,9 @@ class AttributesController extends AppController { $attributes = $this->Attribute->find('all', array('conditions' => array($rC['search'] => $searchPattern), 'recursive' => -1)); foreach ($attributes as &$attribute) { $regex = '/'; - if (!in_array($rC['condition'], array('endsWith', 'contains'))) $regex .= '^'; + if (!in_array($rC['condition'], array('startsWith', 'contains'))) $regex .= '^'; $regex .= $rC['from']; - if (!in_array($rC['condition'], array('startsWith', 'contains'))) $regex .= '$'; + if (!in_array($rC['condition'], array('endsWith', 'contains'))) $regex .= '$'; $regex .= '/'; if ($rC['ci']) $regex .= 'i'; $attribute['Attribute']['value'] = preg_replace($regex, $rC['to'], $attribute['Attribute']['value']);