Index: trunk/extensions/AbuseFilter/AbuseFilter.parser.php |
— | — | @@ -1118,18 +1118,7 @@ |
1119 | 1119 | } |
1120 | 1120 | |
1121 | 1121 | protected function rmdoubles( $s ) { |
1122 | | - $last = -1; |
1123 | | - $ret = array(); |
1124 | | - |
1125 | | - $chars = AntiSpoof::stringToList( $s ); |
1126 | | - |
1127 | | - foreach( $chars as $char) { |
1128 | | - if ($char != $last) |
1129 | | - $ret[] = $char; |
1130 | | - $last = $char; |
1131 | | - } |
1132 | | - |
1133 | | - return AntiSpoof::listToString($ret); |
| 1122 | + return preg_replace( '/(.)\1+/us','\1',$s); |
1134 | 1123 | } |
1135 | 1124 | |
1136 | 1125 | protected function rmwhitespace( $s ) { |