Changeset 22897


Ignore:
Timestamp:
2013/06/25 16:26:42 (11 years ago)
Author:
michael_nelson
Message:

#2273 Merge revisions from 12.2-dev to 2.12-multilang r22861-r22863,r22891-r22892

Location:
branches/version-2_12-multilang
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-multilang

  • branches/version-2_12-multilang/data

  • branches/version-2_12-multilang/data/Smarty/templates/admin/contents/recommend_search.tpl

    r22453 r22897  
    3030 
    3131function func_submit( id ){ 
    32     var fm = window.opener.document.form<!--{$smarty.get.rank}-->; 
     32    var fm = window.opener.document.form<!--{$rank|h}-->; 
    3333    fm.product_id.value = id; 
    3434    fm.mode.value = 'set_item'; 
    35     fm.rank.value = '<!--{$smarty.get.rank}-->'; 
     35    fm.rank.value = '<!--{$rank|h}-->'; 
    3636    fm.submit(); 
    3737    window.close(); 
  • branches/version-2_12-multilang/data/class/SC_CheckError.php

    r22510 r22897  
    104104            return; 
    105105        } 
    106         $this->createParam($value); 
     106        // $this->createParam($value); 
    107107        if (strlen($this->arrParam[$value[0]]) == 0) { 
    108108            $this->arrErr[$value[0]] = t('c_* T_ARG1 is blank. <br />_01', array('T_ARG1' => $value[1])); 
     
    183183            return; 
    184184        } 
    185         $this->createParam($value); 
     185        // $this->createParam($value); 
    186186        // 文字数の取得 
    187187        if ($this->arrParam[$value[2]] !== $this->arrParam[$value[3]]) { 
     
    201201            return; 
    202202        } 
    203         $this->createParam($value); 
     203        // $this->createParam($value); 
    204204        // 文字数の取得 
    205205        if ($this->arrParam[$value[2]] == $this->arrParam[$value[3]]) { 
     
    219219            return; 
    220220        } 
    221         $this->createParam($value); 
     221        // $this->createParam($value); 
    222222        // 文字数の取得 
    223223        if ($this->arrParam[$value[2]] != '' && $this->arrParam[$value[3]] != '' && ($this->arrParam[$value[2]] > $this->arrParam[$value[3]])) { 
     
    930930            return; 
    931931        } 
    932         $this->createParam($value); 
     932        // $this->createParam($value); 
    933933        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]])) { 
    934934            $this->arrErr[$value[2]] = t('c_* Specify T_ARG1 correctly. <br />_01', array('T_ARG1' => $value[0])); 
     
    980980            return; 
    981981        } 
    982         $this->createParam($value); 
     982        // $this->createParam($value); 
    983983        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]]) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]])) { 
    984984            $this->arrErr[$value[2]] = t('c_* Specify T_ARG1 correctly. <br />_01', array('T_ARG1' => $value[0])); 
     
    10231023            return; 
    10241024        } 
    1025         $this->createParam($value); 
     1025        // $this->createParam($value); 
    10261026        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]])) { 
    10271027            $this->arrErr[$value[2]] = t('c_* Specify T_ARG1 correctly. <br />_01', array('T_ARG1' => $value[0])); 
     
    11351135            return; 
    11361136        } 
    1137         $this->createParam($value); 
     1137        // $this->createParam($value); 
    11381138        if ($this->evalCheck($value[1]) === false) { 
    11391139            $this->arrErr[$value[0]] = t('c_* The T_ARG1 format is incorrect. <br />_01', array('T_ARG1' => $value[0])); 
     
    11641164     */ 
    11651165    function createParam($value) { 
    1166         foreach ($value as $key) { 
    1167             if (is_string($key) || is_int($key)) { 
    1168                 if (!isset($this->arrParam[$key]))  $this->arrParam[$key] = ''; 
    1169             } 
    1170         } 
     1166         foreach ($value as $val_key => $key) { 
     1167             if ($val_key != 0 && (is_string($key) || is_int($key))) { 
     1168                 if (!is_numeric($key) && preg_match('/^[a-z0-9_]+$/i', $key)) { 
     1169                     if (!isset($this->arrParam[$key])) $this->arrParam[$key] = ''; 
     1170                     if (strlen($this->arrParam[$key]) > 0 
     1171                           && (preg_match('/^[[:alnum:]\-\_]*[\.\/\\\\]*\.\.(\/|\\\\)/',$this->arrParam[$key]) || !preg_match('/\A[^\x00-\x08\x0b\x0c\x0e-\x1f\x7f]+\z/u', $this->arrParam[$key]))) 
     1172                           ) { 
     1173                         $this->arrErr[$value[1]] = '※ ' . $value[0] . ' is not a valid character.<br />'; 
     1174                     } 
     1175                 } else if (preg_match('/[^a-z0-9_]/i', $key)) { 
     1176                     trigger_error('', E_USER_ERROR); 
     1177                 } 
     1178             } 
     1179         } 
    11711180    } 
    11721181 
  • branches/version-2_12-multilang/data/class/SC_FormParam.php

    r22496 r22897  
    277277            } 
    278278        } else { 
    279             $objErr = new SC_CheckError_Ex(array(0 => $value)); 
    280             $objErr->doFunc(array($disp_name, 0, $length), array($func)); 
     279            $objErr = new SC_CheckError_Ex(array(($error_last_key ? $error_last_key : $error_key) => $value)); 
     280            $objErr->doFunc(array($disp_name, ($error_last_key ? $error_last_key : $error_key), $length), array($func)); 
    281281            if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { 
    282282                foreach ($objErr->arrErr as $message) { 
  • branches/version-2_12-multilang/data/class/pages/LC_Page_ResizeImage.php

    r22496 r22897  
    106106     */ 
    107107    function lfCheckFileName() { 
    108         //$pattern = '|^[0-9]+_[0-9a-z]+\.[a-z]{3}$|'; 
    109         $pattern = '|\./|'; 
    110108        $file    = trim($_GET['image']); 
    111         if (preg_match_all($pattern, $file, $matches)) { 
     109        if (!preg_match("/^[[:alnum:]_\.-]+$/i", $file)) { 
    112110            return false; 
    113111        } else { 
  • branches/version-2_12-multilang/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php

    r22503 r22897  
    7272        $objFormParam->setParam($_POST); 
    7373        $objFormParam->convParam(); 
     74 
     75        $rank = intval($_GET['rank']); 
    7476 
    7577        switch ($this->getMode()) { 
     
    104106        // カテゴリ取得 
    105107        $this->arrCatList = $objDb->sfGetCategoryList(); 
     108        $this->rank       = $rank; 
    106109        $this->setTemplate('contents/recommend_search.tpl'); 
    107110 
  • branches/version-2_12-multilang/data/class/pages/products/LC_Page_Products_List.php

    r22504 r22897  
    9898        $objProduct = new SC_Product_Ex(); 
    9999 
    100         $this->arrForm = $_REQUEST;//時間が無いのでコレで勘弁してください。 tao_s 
     100        // パラメーター管理クラス 
     101        $objFormParam = new SC_FormParam_Ex();         
     102         
     103        // パラメーター情報の初期化 
     104        $this->lfInitParam($objFormParam); 
     105         
     106        // 値の設定 
     107        $objFormParam->setParam($_REQUEST); 
     108         
     109        // 入力値の変換 
     110        $objFormParam->convParam(); 
     111         
     112        // 値の取得 
     113        $this->arrForm = $objFormParam->getHashArray(); 
     114 
    101115        //modeの取得 
    102116        $this->mode = $this->getMode(); 
     
    155169    function destroy() { 
    156170        parent::destroy(); 
     171    } 
     172 
     173    /* パラメーター情報の初期化 */ 
     174    function lfInitParam(&$objFormParam) 
     175    { 
     176        $objFormParam->addParam('Product ID', 'product_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     177        $objFormParam->addParam('Product name', 'name', STEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); 
     178 
     179        $objFormParam->addParam('Category ID', 'category_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     180        $objFormParam->addParam('Maker ID', 'maker_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     181         
     182        $objFormParam->addParam('Sort order', 'orderby', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); 
     183        $objFormParam->addParam('Product ID', 'pageno', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     184        $objFormParam->addParam('Favorite product ID', 'disp_number', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     185 
     186        $objFormParam->addParam('Category ID', 'category_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     187        $objFormParam->addParam('Prodyct Class ID', 'product_class_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     188        $objFormParam->addParam('Category class ID', 'classcategory_id1', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     189        $objFormParam->addParam('Category Class ID', 'classcategory_id2', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
     190        $objFormParam->addParam('Quantity', 'quantity', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); 
    157191    } 
    158192 
     
    406440                $arrProducts[$key]['quantity']          = $arrForm['quantity']; 
    407441                $arrProducts[$key]['arrErr']            = $arrErr; 
    408                 $js_fnOnLoad .= "fnSetClassCategories(document.product_form{$arrProducts[$key]['product_id']}, '{$arrForm['classcategory_id2']}');"; 
     442                $classcategory_id2 = SC_Utils_Ex::jsonEncode($arrForm['classcategory_id2']); 
     443                $js_fnOnLoad .= "fnSetClassCategories(document.product_form{$arrProducts[$key]['product_id']}, {$classcategory_id2});"; 
    409444            } 
    410445        } 
Note: See TracChangeset for help on using the changeset viewer.