mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #1051 from uniun/patch-3
BUG removeRequiredField() should use array_splice() instead of unset()
This commit is contained in:
commit
42a73715cf
@ -119,9 +119,9 @@ class RequiredFields extends Validator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function removeRequiredField($field) {
|
public function removeRequiredField($field) {
|
||||||
for($i=0; $i<count($this->required); $i++) {
|
foreach ($this->required as $i => $required) {
|
||||||
if($field == $this->required[$i]) {
|
if ($field == $required) {
|
||||||
unset($this->required[$i]);
|
array_splice($this->required, $i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user