mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02: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) {
|
||||
for($i=0; $i<count($this->required); $i++) {
|
||||
if($field == $this->required[$i]) {
|
||||
unset($this->required[$i]);
|
||||
foreach ($this->required as $i => $required) {
|
||||
if ($field == $required) {
|
||||
array_splice($this->required, $i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user