diff --git a/lib/editor/popups/preview.php b/lib/editor/popups/preview.php index dd39333c7b4..f2db186ada9 100644 --- a/lib/editor/popups/preview.php +++ b/lib/editor/popups/preview.php @@ -18,6 +18,7 @@ $imageurl = rawurldecode($imageurl); /// Full URL starts with $CFG->wwwroot/file.php $imagepath = str_replace("$CFG->wwwroot/file.php", '', $imageurl); + $imagepath = str_replace("?file=", '', $imagepath); // if we're using second option of file path. if ($imagepath != $imageurl) { /// This is an internal image $size = getimagesize($CFG->dataroot.$imagepath);