From fd18328d4231830bd88822c888479f24e29b5c3f Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 29 Jan 2005 10:03:09 +0000 Subject: [PATCH] better cleaning of imageurl SC#54, merged from MOODLE_14_STABLE --- lib/editor/popups/preview.php | 58 +++++++++++++---------------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/lib/editor/popups/preview.php b/lib/editor/popups/preview.php index 4fa83df06c..2240220e5a 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 "\n"; - echo "Preview\n"; - echo "\n"; - echo "\n"; - echo "\n"; - print "\"\""; - echo "\n\n"; - ?> + + + +Preview + + + + + + + + -- 2.39.5