Changeset 15035 for branches/rel/html/resize_image.php
- Timestamp:
- 2007/07/10 22:12:44 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rel/html/resize_image.php
r13448 r15035 5 5 6 6 require_once($include_dir . HTML2DATA_DIR. "lib/gdthumb.php"); 7 require_once($include_dir . HTML2DATA_DIR. "conf/conf.php"); 7 require_once($include_dir . HTML2DATA_DIR. "conf/conf.php"); 8 8 9 9 $objThumb = new gdthumb(); 10 10 11 $file = $_GET["image"]; 11 $file = NO_IMAGE_DIR; 12 13 // NO_IMAGE_DIR°Ê³°¤Î¥Õ¥¡¥¤¥ë̾¤¬ÅϤµ¤ì¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë̾¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦ 14 if ( isset($_GET['image']) && $_GET['image'] !== NO_IMAGE_DIR) { 15 16 //ÉÔÀµ¤Ê¥Õ¥¡¥¤¥ë̾¤¬ÅϤµ¤ì¤¿¾ì¹ç¤Ï½ªÎ»¤µ¤»¤ë 17 if ( lfCheckFileName() !== true ) { 18 exit(); 19 } 20 21 $file = IMAGE_SAVE_DIR . $_GET['image']; 22 } 23 12 24 if(file_exists($file)){ 13 25 $objThumb->Main($file, $_GET["width"], $_GET["height"], "", true); 14 26 }else{ 15 $objThumb->Main(NO_IMAGE_DIR, $_GET["width"], $_GET["height"], "", true); 27 $objThumb->Main(NO_IMAGE_DIR, $_GET["width"], $_GET["height"], "", true); 28 } 29 30 // ¥Õ¥¡¥¤¥ë̾¤Î·Á¼°¤ò¥Á¥§¥Ã¥¯ 31 function lfCheckFileName() { 32 //$pattern = '|^[0-9]+_[0-9a-z]+\.[a-z]{3}$|'; 33 $pattern = '|\.\./|'; 34 $file = trim($_GET["image"]); 35 if ( preg_match_all($pattern, $file, $matches) ) { 36 return false; 37 } else { 38 return true; 39 } 16 40 } 17 41
Note: See TracChangeset
for help on using the changeset viewer.