ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 6898


Ignore:
Timestamp:
May 1, 2008, 7:46:04 PM (11 years ago)
Author:
ebihara
Message:

#2162:バナー変更時に画像の形式チェックをおこなうよう修正

Location:
OpenPNE/branches/stable-2.10.x/webapp/modules/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.10.x/webapp/modules/admin/do/update_c_banner.php

    r1856 r6898  
    1212        $c_banner_id = $requests['c_banner_id'];
    1313
    14         //c_image delete && insert
    15         if ($_FILES['upfile']['name']) {
     14        $upfile_obj = $_FILES['upfile'];
     15        if (!empty($upfile_obj) && $upfile_obj['error'] !== UPLOAD_ERR_NO_FILE) {
     16            if (!($image = t_check_image($upfile_obj))) {
     17                $tail = '&c_banner_id=' . $c_banner_id;
     18                admin_client_redirect('update_c_banner', '画像は' . IMAGE_MAX_FILESIZE . 'KB以内のGIF・JPEG・PNGにしてください', $tail);
     19            }
     20
    1621            db_admin_delete_c_image4c_banner_id($c_banner_id);
    1722
    18             $ext = t_check_image_format($_FILES['upfile']);
    19             $c_banner['image_filename'] = "b_{$c_banner_id}_".time().".{$ext}";
    20             admin_insert_c_image($_FILES['upfile'], $c_banner['image_filename']);
     23            $ext = t_check_image_format($upfile_obj);
     24            $c_banner['image_filename'] = sprintf('b_%d_%d.%s', $c_banner_id, time(), $ext);
     25            admin_insert_c_image($upfile_obj, $c_banner['image_filename']);
    2126        }
    22         //c_image delete && insert
    2327
    2428        $c_banner['a_href'] = $requests['a_href'];
     
    2832        $c_banner['is_hidden_after'] = $requests['is_hidden_after'];
    2933
    30         //c_banner update
    3134        db_admin_update_c_banner($c_banner_id, $c_banner);
    32         //c_banner update
    3335
    3436        admin_client_redirect('edit_c_banner', 'バナーを変更しました');
  • OpenPNE/branches/stable-2.10.x/webapp/modules/admin/templates/update_c_banner.tpl

    r2803 r6898  
    77({*ここまで:navi*})
    88
     9({if $msg})<p class="actionMsg">({$msg})</p>({/if})
    910<h2>バナー変更</h2>
    1011<div class="contents">
Note: See TracChangeset for help on using the changeset viewer.