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

Changeset 1465


Ignore:
Timestamp:
Dec 29, 2006, 8:33:10 PM (14 years ago)
Author:
ogawa
Message:

管理画面の画像アップロード時のファイル名に制限を追加

Location:
OpenPNE/branches/ogawa/prj_prep26/webapp/modules/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/ogawa/prj_prep26/webapp/modules/admin/do/insert_c_image.php

    r1282 r1465  
    88class admin_do_insert_c_image extends OpenPNE_Action
    99{
     10    function handleError($errors)
     11    {
     12        admin_client_redirect('edit_c_image', array_shift($errors));
     13    }
     14
    1015    function execute($requests)
    1116    {
    12         if (!empty($_FILES['upfile']) && !empty($requests['filename'])) {
     17        if (!empty($_FILES['upfile']) && $_FILES['upfile']['error'] !== UPLOAD_ERR_NO_FILE && !empty($requests['filename'])) {
    1318            image_data_delete($requests['filename']);
    1419            admin_insert_c_image($_FILES['upfile'], $requests['filename']);
  • OpenPNE/branches/ogawa/prj_prep26/webapp/modules/admin/validate/do/insert_c_image.ini

    r2 r1465  
    11[filename]
    2 type = "string"
    3 
     2type = "regexp"
     3regexp = "/^\w+(?:\.((?:jpe?g)|(?:gif)|(?:png)))?$/"
     4caption = "ファイル名"
Note: See TracChangeset for help on using the changeset viewer.