X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FDateFormatter.php;h=cfd53702fa788f9b19c1decea293533abcf33bd3;hb=f8067de9fc4f0fd05508a96f54a3207af7f53679;hp=3ddc9d47644e5c278843e4f7da2517e5f2e1012c;hpb=de31b2474e29fe2f2eea6648b83d01ee53a726b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index 3ddc9d4764..cfd53702fa 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -205,7 +205,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]; } @@ -254,7 +255,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 @@ -293,6 +295,7 @@ class DateFormatter { } } if ( $fail ) { + /** @todo FIXME: $matches doesn't exist here, what's expected? */ $text = $matches[0]; } @@ -354,6 +357,7 @@ class DateFormatter { /** * @todo document + * @param string $iso * @return int|string */ function makeNormalYear( $iso ) {