mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-12 08:49:28 +00:00
Use multibyte-safe string operations in AbuseFilter bug 19333
This commit is contained in:
parent
1a7cdbab58
commit
47d513310d
|
@ -1498,9 +1498,9 @@ class AbuseFilterParser {
|
|||
if ( isset($args[2]) ) {
|
||||
$length = $args[2]->toInt();
|
||||
|
||||
$result = substr( $s, $offset, $length );
|
||||
$result = mb_substr( $s, $offset, $length );
|
||||
} else {
|
||||
$result = substr( $s, $offset );
|
||||
$result = mb_substr( $s, $offset );
|
||||
}
|
||||
|
||||
return new AFPData( AFPData::DString, $result );
|
||||
|
@ -1518,9 +1518,9 @@ class AbuseFilterParser {
|
|||
if ( isset($args[2]) ) {
|
||||
$offset = $args[2]->toInt();
|
||||
|
||||
$result = strpos( $haystack, $needle, $offset );
|
||||
$result = mb_strpos( $haystack, $needle, $offset );
|
||||
} else {
|
||||
$result = strpos( $haystack, $needle );
|
||||
$result = mb_strpos( $haystack, $needle );
|
||||
}
|
||||
|
||||
if ($result === false)
|
||||
|
|
Loading…
Reference in a new issue