From b1e0025d54454db75d67962d0f0af923d7b68f02 Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Thu, 25 Jul 2013 20:54:43 +0200
Subject: [PATCH] Fix rule names wrapped in quotes (final quote was not
 correctly removed)

---
 rules_shipping_advanced.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rules_shipping_advanced.php b/rules_shipping_advanced.php
index 1d68c18..3d81055 100644
--- a/rules_shipping_advanced.php
+++ b/rules_shipping_advanced.php
@@ -180,8 +180,8 @@ class ShippingRule_Advanced extends ShippingRule {
 
 		
 		// Special-case the name assignment, where we don't want to interpret the value as an arithmetic expression!
-		if (preg_match('/^\s*(name)\s*=\s*"?(.*)"?\s*$/i', $rulepart, $matches)) {
-			$this->handleAssignment ($matches[1], $matches[2], $rulepart);
+		if (preg_match('/^\s*(name)\s*=\s*(["\']?)(.*)\2\s*$/i', $rulepart, $matches)) {
+			$this->handleAssignment ($matches[1], $matches[3], $rulepart);
 			return;
 		}
 
-- 
GitLab