Commit ae671d36 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1871018: Embedded image not connecting correctly



When imported Leap2A page with text block containing an embedded image
<img> tag with a src URL from another site

Change-Id: Icfed626a69cbde20fa891f830745b893f29c6ad2
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit c57fe9bd)
parent f73d7864
......@@ -229,10 +229,7 @@ class EmbeddedImage {
$matches = array();
if (preg_match_all(
'#<img([^>]+)src=("|\\")'
. preg_quote(
get_config('wwwroot')
. 'artefact/file/download.php?file='
)
. 'https?\://.*?/artefact/file/download\.php\?file\='
. '([\d]+)'
. '(&|&amp;)embedded=1([^"]*)"#',
$text,
......@@ -242,10 +239,7 @@ class EmbeddedImage {
if (!empty($artefactids["portfolio:artefact$id"])) {
// Replace the old image id by the new one
$regexp[] = '#<img([^>]+)src=("|\\")'
. preg_quote(
get_config('wwwroot')
. 'artefact/file/download.php?file=' . $id
)
. 'https?\://.*?/artefact/file/download\.php\?file\=' . $id
. '(&|&amp;)embedded=1#';
$replacetext[] = '<img$1src="' . get_config('wwwroot')
. 'artefact/file/download.php?file='
......
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