Skip to content
Snippets Groups Projects
Commit 0ad7ff1e authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

add support for SENDFILE_LINK_MODE=rewrite, fixes #174

parent 987aa80e
No related branches found
No related tags found
No related merge requests found
......@@ -674,7 +674,10 @@ abstract class Exercise extends SimpleORMap
}
} else if (is_string($data) && Studip\Markup::isHtml($data)) {
$data = preg_replace_callback('/"\Khttps?:[^"]*/', function($match) {
list($url, $query) = explode('?', html_entity_decode($match[0]));
$url = html_entity_decode($match[0]);
$url = preg_replace('%/download/(?:normal|force_download)/\d/(\w+)/.+%',
'/sendfile.php?file_id=$1', $url);
list($url, $query) = explode('?', $url);
if (is_internal_url($url) && basename($url) === 'sendfile.php') {
parse_str($query, $query_params);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment