From 47d513310d782554f6d6d9e76304e8ff8bf89bef Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Fri, 31 Jul 2009 11:26:30 +0000 Subject: [PATCH] Use multibyte-safe string operations in AbuseFilter bug 19333 --- AbuseFilter.parser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AbuseFilter.parser.php b/AbuseFilter.parser.php index a4a1b5efd..18c884ed0 100644 --- a/AbuseFilter.parser.php +++ b/AbuseFilter.parser.php @@ -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)