diff --git a/h5p.classes.php b/h5p.classes.php index 57af7224..3ebf0807 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; }