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 May 21, 2024
1 parent ebbf073 commit 607448f
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 607448f

Please sign in to comment.