diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 47fdc3979..b9fcf9502 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -447,10 +447,11 @@ class Inflector extends Object { '/Ü/' => 'Ue', '/Ö/' => 'Oe', '/ß/' => 'ss', - '/[^\w\s]/' => ' ', + '/[^\w\s\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]/mu' => ' ', '/\\s+/' => $replacement, sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '', ); + $map = array_merge($default, $map); return preg_replace(array_keys($map), array_values($map), $string); } diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 0cfc171c9..235dc346d 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -200,6 +200,10 @@ class InflectorTest extends CakeTestCase { $result = Inflector::slug('#this melts your face1#2#3', '-'); $expected = 'this-melts-your-face1-2-3'; $this->assertEqual($result, $expected); + + $result = Inflector::slug('controller/action/りんご/1'); + $expected = 'controller_action_りんご_1'; + $this->assertEqual($result, $expected); } /** * testInflectorSlugWithMap method