Commit c6bb35a2 authored by Nigel McNie's avatar Nigel McNie
Browse files

Consume closing "s on href/src tags when rewriting links, prevents double "s appearing in exports.


Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent 34e35503
...@@ -795,8 +795,8 @@ class LeapExportOutputFilter { ...@@ -795,8 +795,8 @@ class LeapExportOutputFilter {
// Links to download files // Links to download files
$html = preg_replace_callback( $html = preg_replace_callback(
array( array(
'#<(a[^>]+)href="(' . preg_quote(get_config('wwwroot')) . ')?/?artefact/file/download\.php\?file=(\d+)(&amp;view=\d+)?([^>]*)>#', '#<(a[^>]+)href="(' . preg_quote(get_config('wwwroot')) . ')?/?artefact/file/download\.php\?file=(\d+)(&amp;view=\d+)?"([^>]*)>#',
'#<(img[^>]+)src="(' . preg_quote(get_config('wwwroot')) . ')?/?artefact/file/download\.php\?file=(\d+)(&amp;view=\d+)?([^>]*)>#', '#<(img[^>]+)src="(' . preg_quote(get_config('wwwroot')) . ')?/?artefact/file/download\.php\?file=(\d+)(&amp;view=\d+)?"([^>]*)>#',
), ),
array($this, 'replace_download_link'), array($this, 'replace_download_link'),
$html $html
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment