Index: branches/preferences-work/extensions/AbuseFilter/AbuseFilter.parser.php |
— | — | @@ -1089,16 +1089,20 @@ |
1090 | 1090 | } |
1091 | 1091 | |
1092 | 1092 | protected function ccnorm( $s ) { |
1093 | | - if (!class_exists( 'AntiSpoof' ) ) { |
1094 | | - return $s; |
| 1093 | + static $equivset = null; |
| 1094 | + |
| 1095 | + if ( is_null( $equivset ) ) { |
| 1096 | + global $IP; |
| 1097 | + require( "$IP/extensions/AntiSpoof/equivset.php" ); |
1095 | 1098 | } |
1096 | 1099 | |
1097 | | - // Normalise confusable characters. |
1098 | | - $chars = AntiSpoof::stringToList( $s ); |
1099 | | - $chars = AntiSpoof::equivString( $chars ); |
1100 | | - $s = AntiSpoof::listToString( $chars ); |
1101 | | - |
1102 | | - return $s; |
| 1100 | + if (function_exists('fss_prep_replace')) { |
| 1101 | + $fss = fss_prep_replace( $equivset ); |
| 1102 | + |
| 1103 | + return fss_exec_replace( $fss, $s ); |
| 1104 | + } else { |
| 1105 | + return strtr( $s, $equivset ); |
| 1106 | + } |
1103 | 1107 | } |
1104 | 1108 | |
1105 | 1109 | protected function rmspecials( $s ) { |
— | — | @@ -1201,4 +1205,4 @@ |
1202 | 1206 | return preg_match("#^".strtr(preg_quote($pattern, '#'), array('\*' => '.*', '\?' => '.'))."$#i", $string); |
1203 | 1207 | } // end |
1204 | 1208 | |
1205 | | -} // end if |
\ No newline at end of file |
| 1209 | +} // end if |