Fix missing variable in HTMLFormField exceptions
authorGergő Tisza <tgr.huwiki@gmail.com>
Fri, 1 Apr 2016 12:05:12 +0000 (15:05 +0300)
committerGergő Tisza <tgr.huwiki@gmail.com>
Fri, 1 Apr 2016 12:15:49 +0000 (15:15 +0300)
Change-Id: Ie61f170e9117dde7ece05b04573a3c4902b19e56

includes/htmlform/HTMLFormField.php

index a9c7632..4c8ce82 100644 (file)
@@ -179,7 +179,7 @@ abstract class HTMLFormField {
                                        return true;
 
                                case 'OR':
-                                       foreach ( $params as $p ) {
+                                       foreach ( $params as $i => $p ) {
                                                if ( !is_array( $p ) ) {
                                                        throw new MWException(
                                                                "Expected array, found " . gettype( $p ) . " at index $i"
@@ -205,7 +205,7 @@ abstract class HTMLFormField {
                                        return false;
 
                                case 'NOR':
-                                       foreach ( $params as $p ) {
+                                       foreach ( $params as $i => $p ) {
                                                if ( !is_array( $p ) ) {
                                                        throw new MWException(
                                                                "Expected array, found " . gettype( $p ) . " at index $i"