Pārlūkot izejas kodu

Patch for imgsize to allow only images

pecesama 17 gadus atpakaļ
vecāks
revīzija
358bb659bc
1 mainītis faili ar 7 papildinājumiem un 0 dzēšanām
  1. 7 0
      classes/imgsize.php

+ 7 - 0
classes/imgsize.php Parādīt failu

29
 */
29
 */
30
 
30
 
31
 $img = $_GET['img'];
31
 $img = $_GET['img'];
32
+
33
+$ext=substr($img, -3);
34
+if ($ext != "jpg" && $ext !="gif" && $ext !="png") {
35
+	die("This is not a valid image file!!");
36
+}
37
+
38
+
32
 $percent = $_GET['percent'];
39
 $percent = $_GET['percent'];
33
 $constrain = $_GET['constrain'];
40
 $constrain = $_GET['constrain'];
34
 $w = $_GET['w'];
41
 $w = $_GET['w'];