Update URLSegmentFilter default_replacement ordering
Forward slashes, question marks, equal signs, hashes and colons were never actually be replaced with hyphens due to the order of this array. The regex before it was always blasting it away.
This commit is contained in:
parent
87958e7484
commit
afde618db3
|
@ -35,8 +35,8 @@ class URLSegmentFilter implements FilterInterface
|
|||
'/&/u' => '-and-',
|
||||
'/\s|\+/u' => '-', // remove whitespace/plus
|
||||
'/[_.]+/u' => '-', // underscores and dots to dashes
|
||||
'/[^A-Za-z0-9\-]+/u' => '', // remove non-ASCII chars, only allow alphanumeric and dashes
|
||||
'/[\/\?=#:]+/u' => '-', // remove forward slashes, question marks, equal signs, hashes and colons in case multibyte is allowed (and non-ASCII chars aren't removed)
|
||||
'/[^A-Za-z0-9\-]+/u' => '', // remove non-ASCII chars, only allow alphanumeric and dashes
|
||||
'/[\-]{2,}/u' => '-', // remove duplicate dashes
|
||||
'/^[\-]+/u' => '', // Remove all leading dashes
|
||||
'/[\-]+$/u' => '' // Remove all trailing dashes
|
||||
|
|
Loading…
Reference in New Issue