diff options
Diffstat (limited to 'includes/parser/DateFormatter.php')
-rw-r--r-- | includes/parser/DateFormatter.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index a6092a3fe3f4..54c6dece6881 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -234,7 +234,8 @@ class DateFormatter { $bits = array(); $key = $this->keys[$this->mSource]; - for ( $p = 0; $p < strlen( $key ); $p++ ) { + $keyLength = strlen( $key ); + for ( $p = 0; $p < $keyLength; $p++ ) { if ( $key[$p] != ' ' ) { $bits[$key[$p]] = $matches[$p + 1]; } @@ -283,7 +284,8 @@ class DateFormatter { $bits['d'] = sprintf( '%02d', $bits['j'] ); } - for ( $p = 0; $p < strlen( $format ); $p++ ) { + $formatLength = strlen( $format ); + for ( $p = 0; $p < $formatLength; $p++ ) { $char = $format[$p]; switch ( $char ) { case 'd': # ISO day of month |