Skip to content

Commit 6af8b85

Browse files
committed
Fix: Editor->validator() overloads with false as the first argument wasn't being handled correctly
https://datatables.net/forums/discussion/81192
1 parent 42e7135 commit 6af8b85

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Editor.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -897,14 +897,15 @@ public function validate(&$errors, $data)
897897
*/
898898
public function validator($afterFields, $_ = null)
899899
{
900-
if (is_bool($afterFields) && $afterFields === true) {
901-
return $this->_getSet($this->_validatorAfterFields, $_, true);
902-
}
903-
904900
// Argument shift
905-
$_ = $afterFields;
901+
if (!is_bool($afterFields)) {
902+
$_ = $afterFields;
903+
$afterFields = false;
904+
}
906905

907-
return $this->_getSet($this->_validator, $_, true);
906+
return $afterFields === true
907+
? $this->_getSet($this->_validatorAfterFields, $_, true)
908+
: $this->_getSet($this->_validator, $_, true);
908909
}
909910

910911
/**

0 commit comments

Comments
 (0)