Skip to content

Commit cacbdf4

Browse files
committed
Er, put it in the right place (arghh).
1 parent e8ac443 commit cacbdf4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/cli/cli.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,11 @@ function safe_substr( $str, $start, $length = false, $is_width = false, $encodin
202202
// Set the East Asian Width regex.
203203
$eaw_regex = get_unicode_regexs( 'eaw' );
204204
// If there's any East Asian double-width chars...
205-
if ( preg_match( $eaw_regex, $substr, $dummy /*needed for PHP 5.3*/ ) ) {
205+
if ( preg_match( $eaw_regex, $substr ) ) {
206206
// Note that if the length ends in the middle of a double-width char, the char is included, not excluded.
207207

208208
// See if it's all EAW - the most likely case.
209-
if ( preg_match_all( $eaw_regex, $substr ) === $length ) {
209+
if ( preg_match_all( $eaw_regex, $substr, $dummy /*needed for PHP 5.3*/ ) === $length ) {
210210
// Just halve the length so (rounded up).
211211
$substr = mb_substr( $substr, 0, (int) ( ( $length + 1 ) / 2 ), $encoding );
212212
} else {

0 commit comments

Comments
 (0)