From 607448f8ae18630509db703f60f6611697256bdd Mon Sep 17 00:00:00 2001 From: Markus Klein Date: Wed, 13 Sep 2023 10:16:11 +0200 Subject: [PATCH] [BUGFIX] Correct subject type for preg_match call --- h5p.classes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index c865cb8..ee30d3b 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -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; }