Skip to content
Permalink
Browse files

Fix incorrect regex in Text::slug().

  • Loading branch information...
ADmad committed Oct 5, 2017
1 parent 86eefd1 commit f9d64732924eb149b58585fda318b9dba7209143
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/Utility/Text.php
  2. +2 −2 tests/TestCase/Utility/TextTest.php
@@ -1108,7 +1108,7 @@ public static function slug($string, $options = [])
$regex = '^\s\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}';
if ($options['preserve']) {
$regex .= '|' . preg_quote($options['preserve'], '/');
$regex .= preg_quote($options['preserve'], '/');
}
$quotedReplacement = preg_quote($options['replacement'], '/');
$map = [
@@ -1810,8 +1810,8 @@ public function slugInputProvider()
'cl-ean-me'
],
[
'cl#ean(me.jpg', ['preserve' => '.'],
'cl-ean-me.jpg'
'cl#e|an(me.jpg', ['preserve' => '.'],
'cl-e-an-me.jpg'
],
];
}

0 comments on commit f9d6473

Please sign in to comment.
You can’t perform that action at this time.