Skip to content

Commit

Permalink
[BUGFIX] Correct subject type for preg_match call
Browse files Browse the repository at this point in the history
  • Loading branch information
liayn committed Sep 13, 2023
1 parent 732f54f commit a1a1a31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h5p.classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ private function isValidRequirement($h5pData, $requirement, $library_name, $prop
}
elseif (is_string($h5pData) || is_int($h5pData)) {
// The requirement is a regexp, match it against the data
if (preg_match($requirement, $h5pData) === 0) {
if (preg_match($requirement, (string)$h5pData) === 0) {
$this->h5pF->setErrorMessage($this->h5pF->t("Invalid data provided for %property in %library", ['%property' => $property_name, '%library' => $library_name]));
$valid = FALSE;
}
Expand Down

0 comments on commit a1a1a31

Please sign in to comment.