Merge branch 'wip-mdl-31498-default' of git://github.com/rajeshtaneja/moodle
authorDan Poltawski <dan@moodle.com>
Thu, 3 May 2012 05:26:33 +0000 (13:26 +0800)
committerDan Poltawski <dan@moodle.com>
Thu, 3 May 2012 05:26:33 +0000 (13:26 +0800)
lib/formslib.php

index f66b1d7..530a7aa 100644 (file)
@@ -1000,8 +1000,8 @@ abstract class moodleform {
             foreach ($options as $elementname => $elementoptions){
                 $pos=strpos($elementname, '[');
                 if ($pos!==FALSE){
-                    $realelementname = substr($elementname, 0, $pos+1)."[$i]";
-                    $realelementname .= substr($elementname, $pos+1);
+                    $realelementname = substr($elementname, 0, $pos)."[$i]";
+                    $realelementname .= substr($elementname, $pos);
                 }else {
                     $realelementname = $elementname."[$i]";
                 }