Merge "Remove "Help/Project" profile from Special:Search"
[lhc/web/wiklou.git] / includes / parser / DateFormatter.php
index 3ddc9d4..cfd5370 100644 (file)
@@ -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 ) {