From d5177157179fe66d7dc6872e4871e821637392e7 Mon Sep 17 00:00:00 2001 From: iBNu Maksum Date: Wed, 21 Oct 2020 14:50:27 +0700 Subject: [PATCH] add - on regex so it not replaced --- class.coupon.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class.coupon.php b/class.coupon.php index 48d5c5a..6a81efb 100644 --- a/class.coupon.php +++ b/class.coupon.php @@ -124,7 +124,7 @@ static private function cleanString($string, $options = []) { $toUpper = (isset($options['uppercase']) ? filter_var($options['uppercase'], FILTER_VALIDATE_BOOLEAN) : false); $toLower = (isset($options['lowercase']) ? filter_var($options['lowercase'], FILTER_VALIDATE_BOOLEAN) : false); - $striped = preg_replace('/[^a-zA-Z0-9]/', '', trim($string)); + $striped = preg_replace('/[^a-zA-Z0-9-]/', '', trim($string)); // make uppercase if ($toLower && $toUpper) {