Skip to content

Commit

Permalink
fix --allow-risky=yes
Browse files Browse the repository at this point in the history
  • Loading branch information
nobuhiko committed Dec 23, 2024
1 parent b3a3438 commit 3148975
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions data/class/pages/admin/products/LC_Page_Admin_Products_Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,18 @@ public function lfInitFormParam(&$objFormParam, $arrPost)
$objFormParam->addParam('temp_main_large_image', 'temp_main_large_image', '', '', []);

for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
$objFormParam->addParam('詳細-サブタイトル' . $cnt, 'sub_title' . $cnt, STEXT_LEN, 'KVa', ['SPTAB_CHECK', 'MAX_LENGTH_CHECK']);
$objFormParam->addParam('詳細-サブコメント' . $cnt, 'sub_comment' . $cnt, LLTEXT_LEN, 'KVa', ['SPTAB_CHECK', 'MAX_LENGTH_CHECK']);
$objFormParam->addParam('save_sub_image' . $cnt, 'save_sub_image' . $cnt, '', '', []);
$objFormParam->addParam('save_sub_large_image' . $cnt, 'save_sub_large_image' . $cnt, '', '', []);
$objFormParam->addParam('temp_sub_image' . $cnt, 'temp_sub_image' . $cnt, '', '', []);
$objFormParam->addParam('temp_sub_large_image' . $cnt, 'temp_sub_large_image' . $cnt, '', '', []);
$objFormParam->addParam('詳細-サブタイトル'.$cnt, 'sub_title'.$cnt, STEXT_LEN, 'KVa', ['SPTAB_CHECK', 'MAX_LENGTH_CHECK']);
$objFormParam->addParam('詳細-サブコメント'.$cnt, 'sub_comment'.$cnt, LLTEXT_LEN, 'KVa', ['SPTAB_CHECK', 'MAX_LENGTH_CHECK']);
$objFormParam->addParam('save_sub_image'.$cnt, 'save_sub_image'.$cnt, '', '', []);
$objFormParam->addParam('save_sub_large_image'.$cnt, 'save_sub_large_image'.$cnt, '', '', []);
$objFormParam->addParam('temp_sub_image'.$cnt, 'temp_sub_image'.$cnt, '', '', []);
$objFormParam->addParam('temp_sub_large_image'.$cnt, 'temp_sub_large_image'.$cnt, '', '', []);
}

for ($cnt = 1; $cnt <= RECOMMEND_PRODUCT_MAX; $cnt++) {
$objFormParam->addParam('関連商品コメント' . $cnt, 'recommend_comment' . $cnt, LTEXT_LEN, 'KVa', ['SPTAB_CHECK', 'MAX_LENGTH_CHECK']);
$objFormParam->addParam('関連商品ID' . $cnt, 'recommend_id' . $cnt, INT_LEN, 'n', ['NUM_CHECK', 'MAX_LENGTH_CHECK']);
$objFormParam->addParam('recommend_delete' . $cnt, 'recommend_delete' . $cnt, '', 'n', []);
$objFormParam->addParam('関連商品コメント'.$cnt, 'recommend_comment'.$cnt, LTEXT_LEN, 'KVa', ['SPTAB_CHECK', 'MAX_LENGTH_CHECK']);
$objFormParam->addParam('関連商品ID'.$cnt, 'recommend_id'.$cnt, INT_LEN, 'n', ['NUM_CHECK', 'MAX_LENGTH_CHECK']);
$objFormParam->addParam('recommend_delete'.$cnt, 'recommend_delete'.$cnt, '', 'n', []);
}

$objFormParam->addParam('商品ID', 'copy_product_id', INT_LEN, 'n', ['NUM_CHECK', 'MAX_LENGTH_CHECK']);
Expand Down Expand Up @@ -478,7 +478,7 @@ public function lfCheckError_Edit(&$objFormParam, &$objUpFile, &$objDownFile, $a
// HTMLタグ許可チェック
$objErr->doFunc(['詳細-メインコメント', 'main_comment', $this->arrAllowedTag], ['HTML_TAG_CHECK']);
for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
$objErr->doFunc(['詳細-サブコメント' . $cnt, 'sub_comment' . $cnt, $this->arrAllowedTag], ['HTML_TAG_CHECK']);
$objErr->doFunc(['詳細-サブコメント'.$cnt, 'sub_comment'.$cnt, $this->arrAllowedTag], ['HTML_TAG_CHECK']);
}

// 規格情報がない商品の場合のチェック
Expand Down Expand Up @@ -512,18 +512,18 @@ public function lfCheckError_Edit(&$objFormParam, &$objUpFile, &$objDownFile, $a
public function lfCheckError_RecommendSelect(&$arrForm, &$arrErr)
{
$select_recommend_no = $arrForm['select_recommend_no'];
$select_recommend_id = $arrForm['recommend_id' . $select_recommend_no];
$select_recommend_id = $arrForm['recommend_id'.$select_recommend_no];

foreach ($arrForm as $key => $value) {
if (preg_match('/^recommend_id/', $key)) {
if ($select_recommend_no == preg_replace('/^recommend_id/', '', $key)) {
continue;
}
$delete_key = 'recommend_delete' . (int) str_replace('recommend_id', '', $key);
$delete_key = 'recommend_delete'.(int) str_replace('recommend_id', '', $key);
if ($select_recommend_id == $arrForm[$key] && $arrForm[$delete_key] != 1) {
// 重複した場合、選択されたデータをリセットする
$arrForm['recommend_id' . $select_recommend_no] = '';
$arrErr['recommend_comment' . $select_recommend_no] = '※ すでに登録されている関連商品です。<br />';
$arrForm['recommend_id'.$select_recommend_no] = '';
$arrErr['recommend_comment'.$select_recommend_no] = '※ すでに登録されている関連商品です。<br />';
break;
}
}
Expand Down Expand Up @@ -688,9 +688,9 @@ public function lfSetScaleImage(&$objUpFile, $image_key)
// 一覧メイン画像
$this->lfMakeScaleImage($objUpFile, $image_key, 'main_list_image');
break;
case 'sub_large_image' . $subno:
case 'sub_large_image'.$subno:
// サブメイン画像
$this->lfMakeScaleImage($objUpFile, $_POST['image_key'], 'sub_image' . $subno);
$this->lfMakeScaleImage($objUpFile, $_POST['image_key'], 'sub_image'.$subno);
break;
default:
break;
Expand Down Expand Up @@ -730,9 +730,9 @@ public function lfMakeScaleImage(&$objUpFile, $from_key, $to_key, $forced = fals
$from_path = '';

if ($objUpFile->temp_file[$arrImageKey[$from_key]]) {
$from_path = $objUpFile->temp_dir . $objUpFile->temp_file[$arrImageKey[$from_key]];
$from_path = $objUpFile->temp_dir.$objUpFile->temp_file[$arrImageKey[$from_key]];
} elseif ($objUpFile->save_file[$arrImageKey[$from_key]]) {
$from_path = $objUpFile->save_dir . $objUpFile->save_file[$arrImageKey[$from_key]];
$from_path = $objUpFile->save_dir.$objUpFile->save_file[$arrImageKey[$from_key]];
}

if (file_exists($from_path)) {
Expand All @@ -749,7 +749,7 @@ public function lfMakeScaleImage(&$objUpFile, $from_key, $to_key, $forced = fals
&& empty($objUpFile->save_file[$arrImageKey[$to_key]])
) {
// リネームする際は、自動生成される画像名に一意となるように、Suffixを付ける
$dst_file = $objUpFile->lfGetTmpImageName(IMAGE_RENAME, '', $objUpFile->temp_file[$arrImageKey[$from_key]]) . $this->lfGetAddSuffix($to_key);
$dst_file = $objUpFile->lfGetTmpImageName(IMAGE_RENAME, '', $objUpFile->temp_file[$arrImageKey[$from_key]]).$this->lfGetAddSuffix($to_key);
$path = $objUpFile->makeThumb($from_path, $to_w, $to_h, $dst_file);
$objUpFile->temp_file[$arrImageKey[$to_key]] = basename($path);
}
Expand Down Expand Up @@ -963,8 +963,8 @@ public function lfGetRecommendProductsData_FromDB($product_id)

$no = 1;
foreach ($arrRet as $arrVal) {
$arrRecommendProducts['recommend_id' . $no] = $arrVal['recommend_product_id'];
$arrRecommendProducts['recommend_comment' . $no] = $arrVal['comment'];
$arrRecommendProducts['recommend_id'.$no] = $arrVal['recommend_product_id'];
$arrRecommendProducts['recommend_comment'.$no] = $arrVal['comment'];
$no++;
}

Expand All @@ -983,9 +983,9 @@ public function lfGetRecommendProducts(&$arrForm)
$arrRecommend = [];

for ($i = 1; $i <= RECOMMEND_PRODUCT_MAX; $i++) {
$keyname = 'recommend_id' . $i;
$delkey = 'recommend_delete' . $i;
$commentkey = 'recommend_comment' . $i;
$keyname = 'recommend_id'.$i;
$delkey = 'recommend_delete'.$i;
$commentkey = 'recommend_comment'.$i;

if (!isset($arrForm[$delkey])) {
$arrForm[$delkey] = null;
Expand Down Expand Up @@ -1033,7 +1033,7 @@ public function lfGetCategoryList_Edit()
*/
public function lfSetOnloadJavaScript_InputPage($anchor_hash = '')
{
return "eccube.checkStockLimit('" . DISABLED_RGB . "');fnInitSelect('category_id_unselect'); fnMoveSelect('category_id_unselect', 'category_id');" . $anchor_hash;
return "eccube.checkStockLimit('".DISABLED_RGB."');fnInitSelect('category_id_unselect'); fnMoveSelect('category_id_unselect', 'category_id');".$anchor_hash;
}

/**
Expand Down Expand Up @@ -1074,8 +1074,8 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList)
$sqlval = array_merge($sqlval, $arrRet);

for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) {
$sqlval['sub_title' . $cnt] = $arrList['sub_title' . $cnt];
$sqlval['sub_comment' . $cnt] = $arrList['sub_comment' . $cnt];
$sqlval['sub_title'.$cnt] = $arrList['sub_title'.$cnt];
$sqlval['sub_comment'.$cnt] = $arrList['sub_comment'.$cnt];
}

$objQuery->begin();
Expand Down Expand Up @@ -1133,7 +1133,7 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList)
}
}
}
// 更新
// 更新
} else {
$product_id = $arrList['product_id'];
// 削除要求のあった既存ファイルの削除
Expand Down Expand Up @@ -1261,9 +1261,9 @@ public function lfInsertRecommendProducts(&$objQuery, $arrList, $product_id)
$sqlval['product_id'] = $product_id;
$rank = RECOMMEND_PRODUCT_MAX;
for ($i = 1; $i <= RECOMMEND_PRODUCT_MAX; $i++) {
$keyname = 'recommend_id' . $i;
$commentkey = 'recommend_comment' . $i;
$deletekey = 'recommend_delete' . $i;
$keyname = 'recommend_id'.$i;
$commentkey = 'recommend_comment'.$i;
$deletekey = 'recommend_delete'.$i;

if (!isset($arrList[$deletekey])) {
$arrList[$deletekey] = null;
Expand Down Expand Up @@ -1360,7 +1360,7 @@ public function lfGetAddSuffix($to_key)
break;
default:
$arrRet = explode('sub_image', $to_key);
$dist_name = '_sub' . $arrRet[1];
$dist_name = '_sub'.$arrRet[1];
break;
}

Expand All @@ -1381,13 +1381,13 @@ public function hasSubProductData($arrSubProductData)

for ($i = 1; $i <= PRODUCTSUB_MAX; $i++) {
if (
SC_Utils_Ex::isBlank($arrSubProductData['sub_title' . $i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_comment' . $i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_image' . $i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_large_image' . $i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['temp_sub_image' . $i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['temp_sub_large_image' . $i]) == false
|| $arrSubProductData['image_key'] == 'sub_image' . $i
SC_Utils_Ex::isBlank($arrSubProductData['sub_title'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_comment'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_image'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['sub_large_image'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['temp_sub_image'.$i]) == false
|| SC_Utils_Ex::isBlank($arrSubProductData['temp_sub_large_image'.$i]) == false
|| $arrSubProductData['image_key'] == 'sub_image'.$i
) {
$has_subproduct_data = true;
break;
Expand All @@ -1408,7 +1408,7 @@ public function hasSubProductData($arrSubProductData)
public function getAnchorHash($anchor_key)
{
if ($anchor_key != '') {
return "location.hash='#" . htmlspecialchars($anchor_key) . "'";
return "location.hash='#".htmlspecialchars($anchor_key)."'";
} else {
return '';
}
Expand Down

0 comments on commit 3148975

Please sign in to comment.