mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-02 09:32:43 +00:00
parent
a4460ff228
commit
37e387fed2
2 changed files with 5 additions and 2 deletions
|
@ -252,6 +252,9 @@ class InflectorTest extends CakeTestCase {
|
|||
$result = Inflector::slug('posts/view/한국어/page:1/sort:asc');
|
||||
$expected = 'posts_view_한국어_page_1_sort_asc';
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$result = Inflector::slug("non\xc2\xa0breaking\xc2\xa0space");
|
||||
$this->assertEquals('non_breaking_space', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -542,8 +542,8 @@ class Inflector {
|
|||
$quotedReplacement = preg_quote($replacement, '/');
|
||||
|
||||
$merge = array(
|
||||
'/[^\s\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]/mu' => ' ',
|
||||
'/\\s+/' => $replacement,
|
||||
'/[^\s\p{Zs}\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]/mu' => ' ',
|
||||
'/[\s\p{Zs}]+/mu' => $replacement,
|
||||
sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '',
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue