From 44633fc1db2be4c2a6c70932df79378d1282ed58 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 29 Jul 2016 13:46:14 +0200 Subject: [PATCH] Updated regexp to support existing content to new content copy HFJ-2099 --- h5p.classes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index 20ac82a..acca6bf 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -3101,8 +3101,8 @@ class H5PContentValidator { private function _validateFilelike(&$file, $semantics, $typeValidKeys = array()) { // Do not allow to use files from other content folders. $matches = array(); - if (preg_match('/^(\.\.\/){1,2}(\d+|editor)\/(.+)$/', $file->path, $matches)) { - $file->path = $matches[3]; + if (preg_match('/^(\.\.\/){1,2}(.*content\/)?(\d+|editor)\/(.+)$/', $file->path, $matches)) { + $file->path = $matches[4]; } // Make sure path and mime does not have any special chars