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