| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | require_once("../../require.php"); |
|---|
| 4 | |
|---|
| 5 | $file = NO_IMAGE_DIR; |
|---|
| 6 | |
|---|
| 7 | // NO_IMAGE_DIR°Ê³°¤Î¥Õ¥¡¥¤¥ë̾¤¬ÅϤµ¤ì¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë̾¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦ |
|---|
| 8 | if ( isset($_GET['image']) && $_GET['image'] !== NO_IMAGE_DIR) { |
|---|
| 9 | |
|---|
| 10 | // ¥Õ¥¡¥¤¥ë̾¤¬Àµ¤·¤¤¾ì¹ç¤À¤±¡¢$file¤òÀßÄê |
|---|
| 11 | if ( lfCheckFileName() === true ) { |
|---|
| 12 | $file = MODULE_PATH . $_GET['image']; |
|---|
| 13 | } else { |
|---|
| 14 | gfPrintLog('invalid access :resize_image.php $_GET["image"]=' . $_GET['image']); |
|---|
| 15 | } |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | $objThumb = new gdthumb(); |
|---|
| 19 | |
|---|
| 20 | if(file_exists($file)){ |
|---|
| 21 | $objThumb->Main($file, $_GET["width"], $_GET["height"], "", true); |
|---|
| 22 | }else{ |
|---|
| 23 | $objThumb->Main(NO_IMAGE_DIR, $_GET["width"], $_GET["height"], "", true); |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | // ¥Õ¥¡¥¤¥ë̾¤Î·Á¼°¤ò¥Á¥§¥Ã¥¯ |
|---|
| 27 | function lfCheckFileName() { |
|---|
| 28 | $pattern = '|^mdl_icons/icon_[a-zA-Z0-9_]+?\.[a-z]{3}$|'; |
|---|
| 29 | $file = trim($_GET["image"]); |
|---|
| 30 | if ( preg_match($pattern, $file) ) { |
|---|
| 31 | return true; |
|---|
| 32 | } else { |
|---|
| 33 | return false; |
|---|
| 34 | } |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | ?> |
|---|
Note: See
TracBrowser
for help on using the repository browser.