Skip to content

Commit e16d888

Browse files
committed
Restore original checkMode after validation
1 parent ca2b8f5 commit e16d888

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/JsonSchema/Validator.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,13 @@ public function coerce(&$value, $schema = null)
6868
*/
6969
public function validate(&$value, $schema = null, $checkMode = self::CHECK_MODE_NORMAL)
7070
{
71+
$originalCheckMode = $this->factory->getCheckMode();
7172
$this->factory->setCheckMode($checkMode);
72-
return $this->_check($value, $schema);
73+
74+
$checkResult = $this->_check($value, $schema);
75+
76+
$this->factory->setCheckMode($originalCheckMode);
77+
return $checkResult;
7378
}
7479

7580
/**

0 commit comments

Comments
 (0)