Commit 37ba1670 authored by lliss's avatar lliss Committed by generalredneck

[#1832526] Fixing warning 'preg_replace(): Compilation failed: missing...

[#1832526] Fixing warning 'preg_replace(): Compilation failed: missing terminating ] for character class at offset 2'
parent fe37dc85
...@@ -141,15 +141,16 @@ function views_natural_sort_encode($string) { ...@@ -141,15 +141,16 @@ function views_natural_sort_encode($string) {
$words_regex = '/\s(' . implode('|', $words) . ')\s+/i'; $words_regex = '/\s(' . implode('|', $words) . ')\s+/i';
$symbols_regex = '/[' . preg_quote($symbols) . ']/'; $symbols_regex = '/[' . preg_quote($symbols) . ']/';
$string = preg_replace(array( if (!empty($beginning_words)) {
$beginning_words_regex, $string = preg_replace($beginning_words_regex, '', $string);
$symbols_regex, }
$words_regex, if (strlen($symbols) != 0) {
), array( $string = preg_replace($symbols_regex, '', $string);
'', }
'', if (!empty($words)) {
' ', $string = preg_replace($words_regex, ' ', $string);
), $string); }
// Find an optional leading dash (either preceded by whitespace or the first character) followed // Find an optional leading dash (either preceded by whitespace or the first character) followed
// by either: // by either:
// - an optional series of digits (with optional imbedded commas), then a period, then an optional series of digits OR // - an optional series of digits (with optional imbedded commas), then a period, then an optional series of digits OR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment