diff --git a/lib/editor/popups/preview.php b/lib/editor/popups/preview.php
index 1c131efabc5..2240220e5aa 100644
--- a/lib/editor/popups/preview.php
+++ b/lib/editor/popups/preview.php
@@ -1,12 +1,11 @@
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.
+ $imagetag = clean_text('');
- $size = null;
- if ($imagepath != $imageurl) { /// This is an internal image
- $size = getimagesize($CFG->dataroot.$imagepath);
- }
-
- $width = $size[0];
- $height = $size[1];
- settype($width, "integer");
- settype($height, "integer");
-
- if ($height >= 200) {
- $division = ($height / 190);
- $width = round($width / $division);
- $height = 190;
- }
- echo "\n";
- echo "\n";
- echo "