diff --git a/service/src/main/php/src/tools/h5p/H5P.php b/service/src/main/php/src/tools/h5p/H5P.php index 2d80a37..e51a0d2 100644 --- a/service/src/main/php/src/tools/h5p/H5P.php +++ b/service/src/main/php/src/tools/h5p/H5P.php @@ -160,7 +160,7 @@ public function showEditor($content, Response $response) { $integration = array(); $integration['baseUrl'] = WWWURL; //$integration['url'] = '/eduConnector/src/tools/h5p'; - $integration['url'] = '/eduConnector/src/tools/h5p/cache'; + $integration['url'] = WWWURL . '/src/tools/h5p/cache'; $integration['siteUrl'] = WWWURL; $integration['postUserStatistics'] = ''; $integration['ajax'] = array(); diff --git a/service/src/main/php/src/tools/h5p/cache/.htaccess b/service/src/main/php/src/tools/h5p/cache/.htaccess index fef6ab8..84bf4d9 100644 --- a/service/src/main/php/src/tools/h5p/cache/.htaccess +++ b/service/src/main/php/src/tools/h5p/cache/.htaccess @@ -2,4 +2,4 @@ Options FollowSymLinks RewriteEngine On -RewriteRule ^.* ../redirect.php?ID=%{REQUEST_URI}&%{QUERY_STRING} +RewriteRule (^.*) ../redirect.php?ID=%{THE_REQUEST} [PT,B,QSA] \ No newline at end of file diff --git a/service/src/main/php/src/tools/h5p/redirect.php b/service/src/main/php/src/tools/h5p/redirect.php index 1f33c14..1bccb34 100644 --- a/service/src/main/php/src/tools/h5p/redirect.php +++ b/service/src/main/php/src/tools/h5p/redirect.php @@ -6,8 +6,13 @@ $connector_name = basename(WWWURL); $base = DATA.'/h5p'; -$src_file = str_replace('/'.$connector_name.'/src/tools/h5p/cache', $base, $_REQUEST['ID']); -$src_file = str_replace('/src/tools/h5p/cache', $base, $_REQUEST['ID']); + +$wholeRequest = $_REQUEST['ID']; +$requestUri = explode(' ', $wholeRequest)[1]; +$oldPath = explode('?', $requestUri)[0]; + +$src_file = str_replace('/'.$connector_name.'/src/tools/h5p/cache', $base, $oldPath); +$src_file = str_replace('/src/tools/h5p/cache', $base, $oldPath); $realPath = realpath($src_file); if($realPath === false || strpos($realPath, $base) !== 0) { @@ -15,6 +20,7 @@ return; } +ini_set('memory_limit', '2048M'); $filesize = filesize($src_file); $mimetype = mime_content_type($src_file);