Updated regexp to support existing content to new content copy

HFJ-2099
pull/25/head
Frode Petterson 2016-07-29 13:46:14 +02:00
parent 9f7b545f02
commit 44633fc1db
1 changed files with 2 additions and 2 deletions

View File

@ -3101,8 +3101,8 @@ class H5PContentValidator {
private function _validateFilelike(&$file, $semantics, $typeValidKeys = array()) { private function _validateFilelike(&$file, $semantics, $typeValidKeys = array()) {
// Do not allow to use files from other content folders. // Do not allow to use files from other content folders.
$matches = array(); $matches = array();
if (preg_match('/^(\.\.\/){1,2}(\d+|editor)\/(.+)$/', $file->path, $matches)) { if (preg_match('/^(\.\.\/){1,2}(.*content\/)?(\d+|editor)\/(.+)$/', $file->path, $matches)) {
$file->path = $matches[3]; $file->path = $matches[4];
} }
// Make sure path and mime does not have any special chars // Make sure path and mime does not have any special chars