From 274c0c2f40256eba450b8d595f76fd6cc76afb58 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Tue, 25 Jun 2019 18:26:41 +0900 Subject: [PATCH 01/11] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=B1?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E3=81=AE=E8=AD=A6=E5=91=8A=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SC_CheckError/SC_CheckError_CHECK_DATE3Test.php | 2 +- tests/class/SC_UploadFileTest.php | 4 ++-- .../SC_Helper_DB_sfCreateBasisDataCacheTest.php | 6 ++++-- .../SC_Helper_DB_sfGetBasisDataCacheTest.php | 12 +++++++++--- .../SC_Helper_Purchase_cancelOrderTest.php | 2 +- .../SC_Helper_Purchase_completeOrderTest.php | 11 ++++------- .../SC_Helper_Purchase_getShippingsTest.php | 2 +- .../SC_Helper_Purchase_registerOrderCompleteTest.php | 4 +--- .../SC_Helper_Purchase_registerOrderTest.php | 4 ++-- .../SC_Helper_Purchase_rollbackOrderTest.php | 6 +++--- .../SC_Helper_Purchase_saveOrderTempTest.php | 3 ++- ...elper_Purchase_setShipmentItemTempForSoleTest.php | 4 ++-- tests/class/test/util/Test_Utils.php | 5 +++-- 13 files changed, 35 insertions(+), 30 deletions(-) diff --git a/tests/class/SC_CheckError/SC_CheckError_CHECK_DATE3Test.php b/tests/class/SC_CheckError/SC_CheckError_CHECK_DATE3Test.php index 77dcc19748..0769a853c5 100644 --- a/tests/class/SC_CheckError/SC_CheckError_CHECK_DATE3Test.php +++ b/tests/class/SC_CheckError/SC_CheckError_CHECK_DATE3Test.php @@ -1,4 +1,4 @@ -TEisDir() ? rmdir($file->getPathname()) : unlink($file->getPathInfo()); + $file->isDir() ? rmdir($file->getPathname()) : unlink($file->getRealPath()); } rmdir($dir); } @@ -418,7 +418,7 @@ public function testDeleteDownloadFile() $this->objUpFile->makeTempDownFile('down_file'); // $this->objUpFile->setDBDownFile(['down_realfilename' => 'ice500.jpg']); // file exists - $this->objUpFile->deleteDBDownFile('down_realfilename'); + $this->objUpFile->deleteDBDownFile(['down_realfilename' => 'ice500.jpg']); $this->assertFileNotExists($this->saveDir.'/ice500.jpg'); } diff --git a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfCreateBasisDataCacheTest.php b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfCreateBasisDataCacheTest.php index 696a325c90..493635387c 100644 --- a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfCreateBasisDataCacheTest.php +++ b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfCreateBasisDataCacheTest.php @@ -48,7 +48,9 @@ protected function tearDown() ///////////////////////////////////////// public function testsfCreateBasisDataCache_ファイル操作に成功した場合_TRUEを返す() { - unlink($this->cashFilePath); + if (file_exists($this->cashFilePath)) { + unlink($this->cashFilePath); + } $arrData = array( 'id' => '1', 'company_name' => 'testshop' @@ -62,7 +64,7 @@ public function testsfCreateBasisDataCache_ファイル操作に成功した場 class SC_Helper_DB_sfCreateBasisDataCacheMock extends SC_Helper_DB_Ex { - function sfGetBasisData() + public function sfGetBasisData($force = false) { $arrData = array( 'id' => '1', diff --git a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisDataCacheTest.php b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisDataCacheTest.php index 0fc179f1e0..47b6141e57 100644 --- a/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisDataCacheTest.php +++ b/tests/class/helper/SC_Helper_DB/SC_Helper_DB_sfGetBasisDataCacheTest.php @@ -49,7 +49,9 @@ protected function tearDown() public function testSfGetBasisDataCache_キャッシュがなく生成もしない場合_空を返す() { $this->setUpBasisData(); - unlink($this->cashFilePath); + if (file_exists($this->cashFilePath)) { + unlink($this->cashFilePath); + } $this->expected = array(); $this->actual = $this->helper->sfGetBasisDataCache(); $this->verify(); @@ -58,7 +60,9 @@ public function testSfGetBasisDataCache_キャッシュがなく生成もしな public function testSfGetBasisDataCache_キャッシュがなく生成する場合_キャッシュの値を返す() { $this->setUpBasisData(); - unlink($this->cashFilePath); + if (file_exists($this->cashFilePath)) { + unlink($this->cashFilePath); + } $this->expected = array( 'id' => '1', 'company_name' => 'testshop', @@ -132,7 +136,9 @@ public function testSfGetBasisDataCache_キャッシュがなく生成する場 public function testSfGetBasisDataCache_キャッシュがある場合_キャッシュの値を返す() { $this->setUpBasisData(); - unlink($this->cashFilePath); + if (file_exists($this->cashFilePath)) { + unlink($this->cashFilePath); + } $this->helper->sfCreateBasisDataCache(); $this->expected = array( 'id' => '1', diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cancelOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cancelOrderTest.php index 4ba5d73d03..a45ecbfcae 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cancelOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_cancelOrderTest.php @@ -162,7 +162,7 @@ function registerOrder($order_id, $params) ); } - function getOrderDetail($order_id) + function getOrderDetail($order_id, $has_order_status = true) { $_SESSION['testResult']['getOrderDetail'] = array( 'order_id' => $order_id diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_completeOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_completeOrderTest.php index 2ab5ce7ba5..7f0b3f9429 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_completeOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_completeOrderTest.php @@ -141,7 +141,7 @@ public function testCompleteOrder_顧客IDが指定されていない場合_特 class SC_Helper_Purchase_completeOrderMock extends SC_Helper_Purchase { - function verifyChangeCart($uniqId, $objCartSession) + function verifyChangeCart($uniqId, &$objCartSession) { $_SESSION['testResult']['verifyChangeCart'] = array('uniqId'=>$uniqId); } @@ -152,7 +152,7 @@ function getOrderTemp($uniqId) return parent::getOrderTemp($uniqId); } - function registerOrderComplete($orderTemp, $objCartSession, $cartKey) + function registerOrderComplete($orderTemp, &$objCartSession, $cartKey) { $_SESSION['testResult']['registerOrderComplete'] = array( 'order_temp_id' => $orderTemp['order_temp_id'], @@ -171,14 +171,14 @@ function registerShipmentItem($order_id, $shipping_id, $shipment_item) ); } - function registerShipping($order_id, $shipping_temp) + function registerShipping($order_id, $shipping_temp, $convert_shipping_date = true) { $_SESSION['testResult']['registerShipping'] = array( 'order_id' => $order_id ); } - function cleanupSession($order_id, $objCartSesion, $objCustomer, $cartKey) + function cleanupSession($order_id, &$objCartSesion, &$objCustomer, $cartKey) { $_SESSION['testResult']['cleanupSession'] = array( 'order_id' => $order_id, @@ -186,6 +186,3 @@ function cleanupSession($order_id, $objCartSesion, $objCustomer, $cartKey) ); } } - -?> - diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingsTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingsTest.php index 75d9aea075..3077934a04 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingsTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_getShippingsTest.php @@ -102,7 +102,7 @@ public function testGetShippings_商品取得フラグをOFFにした場合_結 // shipping_idごとの配列になっているのでshipping_idで抽出 $this->actual['first'] = Test_Utils::mapArray($result['1'], array( 'order_id', 'shipping_id', 'shipping_name01', 'shipping_date')); - $this->actual['shipment_item_count'] = count($result['1']['shipment_item']); + $this->actual['shipment_item_count'] = is_array($result['1']['shipment_item']) ? count($result['1']['shipment_item']) : 0; $this->verify('配送情報'); } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderCompleteTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderCompleteTest.php index 7cd010cc62..5c35a7a357 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderCompleteTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderCompleteTest.php @@ -156,7 +156,7 @@ class SC_CartSession_registerOrderCompleteMock extends SC_CartSession { // カートの内容を取得 - function getCartList($cartKey) + function getCartList($cartKey, $pref_id = 0, $country_id = 0) { return array( array( @@ -175,5 +175,3 @@ function getCartList($cartKey) ); } } -?> - diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderTest.php index 08f904acae..5274363e7d 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_registerOrderTest.php @@ -190,7 +190,7 @@ public function testRegisterOrder_受注IDが未指定の場合_新たにIDが class SC_Helper_Purchase_registerOrderMock extends SC_Helper_Purchase { - function sfUpdateOrderStatus($order_id, $status, $add_point, $use_point, $values) + function sfUpdateOrderStatus($order_id, $status = null, $add_point = null, $use_point = null, &$values = array()) { $_SESSION['testResult']['sfUpdateOrderStatus'] = array( 'order_id' => $order_id, @@ -200,7 +200,7 @@ function sfUpdateOrderStatus($order_id, $status, $add_point, $use_point, $values ); } - function sfUpdateOrderNameCol($order_id) + function sfUpdateOrderNameCol($order_id, $temp_table = false) { $_SESSION['testResult']['sfUpdateOrderNameCol'] = $order_id; } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_rollbackOrderTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_rollbackOrderTest.php index 564dae78c1..6e7eb517db 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_rollbackOrderTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_rollbackOrderTest.php @@ -127,7 +127,7 @@ class SC_Helper_Purchase_rollbackOrderMock extends SC_Helper_Purchase { public $testResult = array(); - function cancelOrder($order_id, $orderStatus, $is_delete) + function cancelOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = false) { $this->testResult['cancelOrder'] = array( 'order_id' => $order_id, @@ -146,7 +146,7 @@ function getOrderTempByOrderId($order_id) ); } - function saveOrderTemp($uniqid, $arrOrderTemp, $objCustomer) + function saveOrderTemp($uniqid, $arrOrderTemp, &$objCustomer = null) { $this->testResult['saveOrderTemp'] = array( 'uniqid' => $uniqid, @@ -154,7 +154,7 @@ function saveOrderTemp($uniqid, $arrOrderTemp, $objCustomer) ); } - function verifyChangeCart($uniqid, $objCartSession) + function verifyChangeCart($uniqid, &$objCartSession) { $this->testResult['verifyChangeCart'] = array( 'uniqid' => $uniqid diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveOrderTempTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveOrderTempTest.php index 8c079e4402..c7f5d13b8c 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveOrderTempTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_saveOrderTempTest.php @@ -142,7 +142,8 @@ public function testSaveOrderTemp_注文者情報がある場合_情報がコピ class SC_Helper_Purchase_saveOrderTempMock extends SC_Helper_Purchase { - function copyFromCustomer($sqlval, $objCustomer) + function copyFromCustomer(&$sqlval, &$objCustomer, $prefix = 'order', + $keys = array()) { echo('COPY_FROM_CUSTOMER'); } diff --git a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setShipmentItemTempForSoleTest.php b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setShipmentItemTempForSoleTest.php index 9ee041bed6..fb3977f051 100644 --- a/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setShipmentItemTempForSoleTest.php +++ b/tests/class/helper/SC_Helper_Purchase/SC_Helper_Purchase_setShipmentItemTempForSoleTest.php @@ -72,7 +72,7 @@ public function testSetShipmentItemTempForSole__いったん配送情報がク class SC_Helper_Purchase_setShipmentItemTempForSoleMock extends SC_Helper_Purchase { - function clearShipmentItemTemp() + function clearShipmentItemTemp($shipping_id = null) { $_SESSION['testResult']['clearShipmentItemTemp'] = TRUE; } @@ -86,7 +86,7 @@ function setShipmentItemTemp($shipping_id, $id, $quantity) class SC_CartSession_setShipmentItemTempForSoleMock extends SC_CartSession { - function getCartList($key) + function getCartList($key, $pref_id = 0, $country_id = 0) { return array( array('id'=>'1', 'quantity'=>'10'), diff --git a/tests/class/test/util/Test_Utils.php b/tests/class/test/util/Test_Utils.php index 685e0ac084..b79ac21e80 100644 --- a/tests/class/test/util/Test_Utils.php +++ b/tests/class/test/util/Test_Utils.php @@ -74,11 +74,12 @@ public static function mapCols($input_array, $key) * $orig_arrayが直接変更されます。 * * @static - * @param orig_array 追加先の配列 - * @param new_array 追加要素を持つ配列 + * @param array $orig_array 追加先の配列 + * @param array $new_array 追加要素を持つ配列 */ public static function array_append(&$orig_array, $new_array) { + if (!is_array($new_array)) return; foreach ($new_array as $element) { $orig_array[] = $element; } From fad526a267e4b1d7d8a4f96c5221342108082dc8 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Tue, 25 Jun 2019 18:29:45 +0900 Subject: [PATCH 02/11] =?UTF-8?q?PHP7.3=20=E3=81=A7=E3=81=AE=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_CartSession.php | 11 +++++----- data/class/SC_CheckError.php | 20 +++++++++---------- data/class/SC_Session.php | 5 ++++- data/class/helper/SC_Helper_Purchase.php | 8 ++++---- data/class/helper/SC_Helper_TaxRule.php | 4 ++-- .../products/LC_Page_Products_Detail.php | 2 +- data/class/util/SC_Utils.php | 14 ++++++++----- 7 files changed, 36 insertions(+), 28 deletions(-) diff --git a/data/class/SC_CartSession.php b/data/class/SC_CartSession.php index 7d16df6ee2..1b7c0831a3 100644 --- a/data/class/SC_CartSession.php +++ b/data/class/SC_CartSession.php @@ -54,7 +54,7 @@ public function saveCurrentCart($key_tmp, $productTypeId) { $this->key_tmp = 'savecart_' . $key_tmp; // すでに情報がなければ現状のカート情報を記録しておく - if (count($_SESSION[$this->key_tmp]) == 0) { + if (!isset($_SESSION[$this->key_tmp])) { $_SESSION[$this->key_tmp] = $this->cartSession[$productTypeId]; } // 1世代古いコピー情報は、削除しておく @@ -140,7 +140,8 @@ public function setProductValue($id, $key, $val, $productTypeId) public function getMax($productTypeId) { $max = 0; - if (count($this->cartSession[$productTypeId]) > 0) { + if (is_array($this->cartSession[$productTypeId]) + && count($this->cartSession[$productTypeId]) > 0) { foreach ($this->cartSession[$productTypeId] as $key => $value) { if (is_numeric($key)) { if ($max < $key) { @@ -187,7 +188,7 @@ public function getAllProductsTotal($productTypeId, $pref_id = 0, $country_id = $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], $pref_id, $country_id); - $total+= ($incTax * $quantity); + $total += ($incTax * (int) $quantity); } return $total; @@ -207,7 +208,7 @@ public function getAllProductsTax($productTypeId, $pref_id = 0, $country_id = 0) $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], $pref_id, $country_id); - $total+= ($tax * $quantity); + $total += ($tax * (int) $quantity); } return $total; @@ -234,7 +235,7 @@ public function getAllProductsPoint($productTypeId) $point_rate = $this->cartSession[$productTypeId][$i]['point_rate']; $point = SC_Utils_Ex::sfPrePoint($price, $point_rate); - $total+= ($point * $quantity); + $total += ($point * (int) $quantity); } } diff --git a/data/class/SC_CheckError.php b/data/class/SC_CheckError.php index 40af90927c..2132c31390 100644 --- a/data/class/SC_CheckError.php +++ b/data/class/SC_CheckError.php @@ -1239,7 +1239,7 @@ public function CHECK_DATE($value) if (!(strlen($input_year) > 0 && strlen($input_month) > 0 && strlen($input_day) > 0)) { $this->arrErr[$keyname] = "※ {$disp_name}は全ての項目を入力して下さい。
"; - } elseif (!checkdate($input_month, $input_day, $input_year)) { + } elseif (!checkdate((int) $input_month, (int) $input_day, (int) $input_year)) { $this->arrErr[$keyname] = "※ {$disp_name}が正しくありません。
"; } @@ -1277,7 +1277,7 @@ public function CHECK_DATE2($value) if (!(strlen($input_year) > 0 && strlen($input_month) > 0 && strlen($input_day) > 0 && strlen($input_hour) > 0 && strlen($input_minute) > 0)) { $this->arrErr[$keyname] = "※ {$disp_name}は全ての項目を入力して下さい。
"; - } elseif (! checkdate($input_month, $input_day, $input_year)) { + } elseif (! checkdate((int) $input_month, (int) $input_day, (int) $input_year)) { $this->arrErr[$keyname] = "※ {$disp_name}が正しくありません。
"; } @@ -1307,7 +1307,7 @@ public function CHECK_DATE3($value) if (!(strlen($input_year) > 0 && strlen($input_month) > 0)) { $this->arrErr[$keyname] = "※ {$disp_name}は全ての項目を入力して下さい。
"; - } elseif (! checkdate($input_month, 1, $input_year)) { + } elseif (! checkdate((int) $input_month, 1, (int) $input_year)) { $this->arrErr[$keyname] = "※ {$disp_name}が正しくありません。
"; } @@ -1392,13 +1392,13 @@ public function CHECK_SET_TERM($value) $end_month = $this->arrParam[$value[6]]; $end_day = $this->arrParam[$value[7]]; if ((strlen($start_year) > 0 || strlen($start_month) > 0 || strlen($start_day) > 0) - && ! checkdate($start_month, $start_day, $start_year) + && ! checkdate((int) $start_month, (int) $start_day, (int) $start_year) ) { $this->arrErr[$keyname1] = "※ {$disp_name1}を正しく指定してください。
"; } if ((strlen($end_year) > 0 || strlen($end_month) > 0 || strlen($end_day) > 0) - && ! checkdate($end_month, $end_day, $end_year) + && ! checkdate((int) $end_month, (int) $end_day, (int) $end_year) ) { $this->arrErr[$keyname2] = "※ {$disp_name2}を正しく指定してください。
"; @@ -1469,13 +1469,13 @@ public function CHECK_SET_TERM2($value) $end_minute = $this->arrParam[$value[12]]; $end_second = $this->arrParam[$value[13]]; if ((strlen($start_year) > 0 || strlen($start_month) > 0 || strlen($start_day) > 0 || strlen($start_hour) > 0) - && ! checkdate($start_month, $start_day, $start_year) + && ! checkdate((int) $start_month, (int) $start_day, (int) $start_year) ) { $this->arrErr[$keyname1] = "※ {$disp_name1}を正しく指定してください。
"; } if ((strlen($end_year) > 0 || strlen($end_month) > 0 || strlen($end_day) > 0 || strlen($end_hour) > 0) - && ! checkdate($end_month, $end_day, $end_year) + && ! checkdate((int) $end_month, (int) $end_day, (int) $end_year) ) { $this->arrErr[$keyname2] = "※ {$disp_name2}を正しく指定してください。
"; @@ -1536,13 +1536,13 @@ public function CHECK_SET_TERM3($value) $end_year = $this->arrParam[$value[4]]; $end_month = $this->arrParam[$value[5]]; if ((strlen($start_year) > 0 || strlen($start_month) > 0) - && ! checkdate($start_month, 1, $start_year) + && ! checkdate((int) $start_month, 1, (int) $start_year) ) { $this->arrErr[$keyname1] = "※ {$disp_name1}を正しく指定してください。
"; } if ((strlen($end_year) > 0 || strlen($end_month) > 0) - && ! checkdate($end_month, 1, $end_year) + && ! checkdate((int) $end_month, 1, (int) $end_year) ) { $this->arrErr[$keyname2] = "※ {$disp_name2}を正しく指定してください。
"; @@ -1733,7 +1733,7 @@ public function createParam($value) if ($val_key != 0 && (is_string($key) || is_int($key))) { if (!is_numeric($key) && preg_match('/^[a-z0-9_]+$/i', $key)) { if (!isset($this->arrParam[$key])) $this->arrParam[$key] = ''; - if (strlen($this->arrParam[$key]) > 0 + if (!is_array($this->arrParam[$key]) && strlen($this->arrParam[$key]) > 0 && (preg_match('/^[[:alnum:]\-\_]*[\.\/\\\\]*\.\.(\/|\\\\)/', $this->arrParam[$key]) || !preg_match('/\A[^\x00-\x08\x0b\x0c\x0e-\x1f\x7f]+\z/u', $this->arrParam[$key]))) { $this->arrErr[$value[1]] = '※ ' . $value[0] . 'に禁止された記号の並びまたは制御文字が入っています。
'; } diff --git a/data/class/SC_Session.php b/data/class/SC_Session.php index a7f11020a5..133b7d9229 100644 --- a/data/class/SC_Session.php +++ b/data/class/SC_Session.php @@ -157,6 +157,9 @@ public function logout() */ public function regenerateSID() { - return session_regenerate_id(true); + if (session_status() === PHP_SESSION_ACTIVE) { + return session_regenerate_id(true); + } + return false; } } diff --git a/data/class/helper/SC_Helper_Purchase.php b/data/class/helper/SC_Helper_Purchase.php index b0f4167dd8..31e746edb4 100644 --- a/data/class/helper/SC_Helper_Purchase.php +++ b/data/class/helper/SC_Helper_Purchase.php @@ -176,8 +176,8 @@ public function rollbackOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete $uniqid = $objSiteSession->getUniqId(); if (!empty($arrOrderTemp)) { - - $_SESSION = array_merge($_SESSION, unserialize($arrOrderTemp['session'])); + $tempSession = unserialize($arrOrderTemp['session']); + $_SESSION = array_merge($_SESSION, $tempSession === false ? [] : $tempSession); $objCartSession = new SC_CartSession_Ex(); $objCustomer = new SC_Customer_Ex(); @@ -324,7 +324,7 @@ public function getShippingTemp($has_shipment_item = false) if ($has_shipment_item) { $arrReturn = array(); foreach ($_SESSION['shipping'] as $key => $arrVal) { - if (count($arrVal['shipment_item']) == 0) continue; + if (is_array($arrVal['shipment_item']) && count($arrVal['shipment_item']) == 0) continue; $arrReturn[$key] = $arrVal; } @@ -759,7 +759,7 @@ public function registerShipmentItem($order_id, $shipping_id, $arrParams) * @param array $orderParams 登録する受注情報の配列 * @param SC_CartSession $objCartSession カート情報のインスタンス * @param integer $cartKey 登録を行うカート情報のキー - * @param integer 受注ID + * @return integer 受注ID */ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey) { diff --git a/data/class/helper/SC_Helper_TaxRule.php b/data/class/helper/SC_Helper_TaxRule.php index b1b46d886f..6b386c4dbc 100644 --- a/data/class/helper/SC_Helper_TaxRule.php +++ b/data/class/helper/SC_Helper_TaxRule.php @@ -42,7 +42,7 @@ class SC_Helper_TaxRule */ public static function sfCalcIncTax($price, $product_id = 0, $product_class_id = 0, $pref_id =0, $country_id = 0) { - return $price + SC_Helper_TaxRule_Ex::sfTax($price, $product_id, $product_class_id, $pref_id, $country_id); + return (int) $price + SC_Helper_TaxRule_Ex::sfTax($price, $product_id, $product_class_id, $pref_id, $country_id); } /** @@ -103,7 +103,7 @@ public static function calcTaxFromRuleId($price, $tax_rule_id = 0) public static function calcTax ($price, $tax, $calc_rule, $tax_adjust = 0) { $real_tax = $tax / 100; - $ret = $price * $real_tax; + $ret = (int)$price * $real_tax; $ret = self::roundByCalcRule($ret, $calc_rule); return $ret + $tax_adjust; diff --git a/data/class/pages/products/LC_Page_Products_Detail.php b/data/class/pages/products/LC_Page_Products_Detail.php index ca3c533ef8..3703d9b217 100644 --- a/data/class/pages/products/LC_Page_Products_Detail.php +++ b/data/class/pages/products/LC_Page_Products_Detail.php @@ -291,7 +291,7 @@ public function action() $this->arrRelativeCat = SC_Helper_DB_Ex::sfGetMultiCatTree($product_id); // 商品ステータスを取得 - $this->productStatus = $objProduct->getProductStatus($product_id); + $this->productStatus = $objProduct->getProductStatus(array($product_id)); // 画像ファイル指定がない場合の置換処理 $this->arrProduct['main_image'] diff --git a/data/class/util/SC_Utils.php b/data/class/util/SC_Utils.php index c2f191883b..9ce2601576 100755 --- a/data/class/util/SC_Utils.php +++ b/data/class/util/SC_Utils.php @@ -754,15 +754,15 @@ public function sfRound($value, $pow = 0) /** * ポイント付与 * $product_id が使われていない。 - * @param int $price + * @param float $price * @param float $point_rate * @param int $rule * @return double */ public static function sfPrePoint($price, $point_rate, $rule = POINT_RULE) { - $real_point = $point_rate / 100; - $ret = $price * $real_point; + $real_point = (float) $point_rate / 100; + $ret = (float) $price * $real_point; $ret = SC_Helper_TaxRule_Ex::roundByCalcRule($ret, $rule); return $ret; @@ -1884,7 +1884,8 @@ public static function clearCompliedTemplate() */ public static function copyDirectory($source_path, $dest_path) { - $handle=opendir($source_path); + if (!is_dir($source_path)) return; + $handle = opendir($source_path); while ($filename = readdir($handle)) { if ($filename === '.' || $filename === '..') continue; $cur_path = $source_path . $filename; @@ -1904,12 +1905,15 @@ public static function copyDirectory($source_path, $dest_path) /** * 文字列を区切り文字を挟み反復する * @param string $input 繰り返す文字列。 - * @param string $multiplier input を繰り返す回数。 + * @param int $multiplier input を繰り返す回数。 * @param string $separator 区切り文字 * @return string */ public static function repeatStrWithSeparator($input, $multiplier, $separator = ',') { + if ($multiplier < 1) { + return ''; + } return implode($separator, array_fill(0, $multiplier, $input)); } From 3292e6e81488629554d10d75ab95aa53d118aec9 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Tue, 25 Jun 2019 18:30:33 +0900 Subject: [PATCH 03/11] =?UTF-8?q?count=20=E3=81=A7=20null=20=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92=E3=81=97=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/Smarty/templates/admin/main_frame.tpl | 9 --------- data/Smarty/templates/admin/order/disp.tpl | 2 +- data/Smarty/templates/admin/order/edit.tpl | 2 +- .../admin/ownersstore/plugin_hookpoint_list.tpl | 2 +- data/Smarty/templates/default/header.tpl | 2 +- data/Smarty/templates/default/products/detail.tpl | 2 +- data/Smarty/templates/default/products/list.tpl | 2 +- data/Smarty/templates/mobile/header.tpl | 2 +- data/Smarty/templates/mobile/site_frame.tpl | 2 +- data/Smarty/templates/mobile/site_main.tpl | 12 ++++++------ data/Smarty/templates/sphone/header.tpl | 2 +- data/Smarty/templates/sphone/products/detail.tpl | 2 +- data/Smarty/templates/sphone/products/list.tpl | 2 +- 13 files changed, 17 insertions(+), 26 deletions(-) diff --git a/data/Smarty/templates/admin/main_frame.tpl b/data/Smarty/templates/admin/main_frame.tpl index a79aa7e985..920c038b0c 100644 --- a/data/Smarty/templates/admin/main_frame.tpl +++ b/data/Smarty/templates/admin/main_frame.tpl @@ -61,15 +61,6 @@ }); //]]> - - - - - - - - - diff --git a/data/Smarty/templates/admin/order/disp.tpl b/data/Smarty/templates/admin/order/disp.tpl index 680c7f45b0..70528fdb1a 100644 --- a/data/Smarty/templates/admin/order/disp.tpl +++ b/data/Smarty/templates/admin/order/disp.tpl @@ -382,7 +382,7 @@ - + 情報 diff --git a/data/Smarty/templates/admin/order/edit.tpl b/data/Smarty/templates/admin/order/edit.tpl index 1f435a92bc..265971013a 100644 --- a/data/Smarty/templates/admin/order/edit.tpl +++ b/data/Smarty/templates/admin/order/edit.tpl @@ -769,7 +769,7 @@ - + 情報 diff --git a/data/Smarty/templates/admin/ownersstore/plugin_hookpoint_list.tpl b/data/Smarty/templates/admin/ownersstore/plugin_hookpoint_list.tpl index 5cc96244ae..9925442188 100644 --- a/data/Smarty/templates/admin/ownersstore/plugin_hookpoint_list.tpl +++ b/data/Smarty/templates/admin/ownersstore/plugin_hookpoint_list.tpl @@ -78,7 +78,7 @@ - + bgcolor="pink" rowspan="">
※ 競合中 diff --git a/data/Smarty/templates/default/header.tpl b/data/Smarty/templates/default/header.tpl index 0e26b67f57..e321ccd78a 100755 --- a/data/Smarty/templates/default/header.tpl +++ b/data/Smarty/templates/default/header.tpl @@ -31,7 +31,7 @@
- + --> diff --git a/data/Smarty/templates/default/products/detail.tpl b/data/Smarty/templates/default/products/detail.tpl index 06dfac557e..97170f72c8 100644 --- a/data/Smarty/templates/default/products/detail.tpl +++ b/data/Smarty/templates/default/products/detail.tpl @@ -67,7 +67,7 @@
- +
  • diff --git a/data/Smarty/templates/default/products/list.tpl b/data/Smarty/templates/default/products/list.tpl index 81fd729e02..17f5d71543 100644 --- a/data/Smarty/templates/default/products/list.tpl +++ b/data/Smarty/templates/default/products/list.tpl @@ -155,7 +155,7 @@
    - +
    • diff --git a/data/Smarty/templates/mobile/header.tpl b/data/Smarty/templates/mobile/header.tpl index 40b3db2ef8..c4c46c523a 100755 --- a/data/Smarty/templates/mobile/header.tpl +++ b/data/Smarty/templates/mobile/header.tpl @@ -23,7 +23,7 @@ - + --> diff --git a/data/Smarty/templates/mobile/site_frame.tpl b/data/Smarty/templates/mobile/site_frame.tpl index 5f92f24cb3..96c158a330 100755 --- a/data/Smarty/templates/mobile/site_frame.tpl +++ b/data/Smarty/templates/mobile/site_frame.tpl @@ -40,7 +40,7 @@ - + 」ブロック --> diff --git a/data/Smarty/templates/mobile/site_main.tpl b/data/Smarty/templates/mobile/site_main.tpl index a98b50dd43..f57401a812 100755 --- a/data/Smarty/templates/mobile/site_main.tpl +++ b/data/Smarty/templates/mobile/site_main.tpl @@ -31,7 +31,7 @@ - + --> @@ -53,7 +53,7 @@ - + --> @@ -69,7 +69,7 @@ - + --> @@ -87,7 +87,7 @@ - + --> @@ -101,7 +101,7 @@ - + --> @@ -123,7 +123,7 @@ - + --> diff --git a/data/Smarty/templates/sphone/header.tpl b/data/Smarty/templates/sphone/header.tpl index a3067a2e31..ec9cfe09de 100644 --- a/data/Smarty/templates/sphone/header.tpl +++ b/data/Smarty/templates/sphone/header.tpl @@ -27,7 +27,7 @@
    - + --> diff --git a/data/Smarty/templates/sphone/products/detail.tpl b/data/Smarty/templates/sphone/products/detail.tpl index 1f8f36ca4a..8fab6220f4 100644 --- a/data/Smarty/templates/sphone/products/detail.tpl +++ b/data/Smarty/templates/sphone/products/detail.tpl @@ -124,7 +124,7 @@
    - +
    • diff --git a/data/Smarty/templates/sphone/products/list.tpl b/data/Smarty/templates/sphone/products/list.tpl index 6f02d2ee39..fa065bb904 100644 --- a/data/Smarty/templates/sphone/products/list.tpl +++ b/data/Smarty/templates/sphone/products/list.tpl @@ -78,7 +78,7 @@
      - +
      • From bdb54e9c297d970a6e73bd0a964b371538de2c27 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 28 Jun 2019 19:32:31 +0900 Subject: [PATCH 04/11] Fix session_set_save_handler --- data/class/helper/SC_Helper_Session.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/data/class/helper/SC_Helper_Session.php b/data/class/helper/SC_Helper_Session.php index 127414e19f..2e116d8e32 100644 --- a/data/class/helper/SC_Helper_Session.php +++ b/data/class/helper/SC_Helper_Session.php @@ -24,12 +24,14 @@ class SC_Helper_Session public function __construct() { $this->objDb = new SC_Helper_DB_Ex(); - session_set_save_handler(array(&$this, 'sfSessOpen'), - array(&$this, 'sfSessClose'), - array(&$this, 'sfSessRead'), - array(&$this, 'sfSessWrite'), - array(&$this, 'sfSessDestroy'), - array(&$this, 'sfSessGc')); + if (session_status() !== PHP_SESSION_ACTIVE) { + session_set_save_handler(array(&$this, 'sfSessOpen'), + array(&$this, 'sfSessClose'), + array(&$this, 'sfSessRead'), + array(&$this, 'sfSessWrite'), + array(&$this, 'sfSessDestroy'), + array(&$this, 'sfSessGc')); + } // 通常よりも早い段階(オブジェクトが破棄される前)でセッションデータを書き込んでセッションを終了する // XXX APC による MDB2 の破棄タイミングによる不具合を回避する目的 From 9e18b8268975773a53cd26f31f325afc41441a34 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Sat, 29 Jun 2019 20:17:48 +0900 Subject: [PATCH 05/11] Fix warnings --- data/class/graph/SC_Graph_Base.php | 2 +- data/class/graph/SC_Graph_Pie.php | 4 ++-- data/class/pages/admin/total/LC_Page_Admin_Total.php | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/data/class/graph/SC_Graph_Base.php b/data/class/graph/SC_Graph_Base.php index e6cd5e66f5..36871bbf72 100644 --- a/data/class/graph/SC_Graph_Base.php +++ b/data/class/graph/SC_Graph_Base.php @@ -338,7 +338,7 @@ public function debugPrint($text) public function drawLegend($legend_max = '', $clabelbg = true) { // 凡例が登録されていなければ中止 - if (count($this->arrLegend) <= 0) { + if (empty($this->arrLegend)) { return; } diff --git a/data/class/graph/SC_Graph_Pie.php b/data/class/graph/SC_Graph_Pie.php index 20eb21506b..f9aff81049 100644 --- a/data/class/graph/SC_Graph_Pie.php +++ b/data/class/graph/SC_Graph_Pie.php @@ -45,8 +45,8 @@ public function __construct($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = PIE_LEFT, // データを360°値に変換する public function getCircleData($array) { - $total = ''; - $new_total = ''; + $total = 0; + $new_total = 0; if (!is_array($array)) { return; } diff --git a/data/class/pages/admin/total/LC_Page_Admin_Total.php b/data/class/pages/admin/total/LC_Page_Admin_Total.php index 724f6c8e36..3bb843ffc3 100644 --- a/data/class/pages/admin/total/LC_Page_Admin_Total.php +++ b/data/class/pages/admin/total/LC_Page_Admin_Total.php @@ -740,6 +740,8 @@ public function lfAddBlankLine($arrResults, $type, $st, $ed) { $arrDateList = $this->lfDateTimeArray($type, $st, $ed); + $arrDateResults = array(); + $arrRet = array(); foreach ($arrResults as $arrResult) { $strdate = $arrResult['str_date']; $arrDateResults[$strdate] = $arrResult; @@ -809,7 +811,7 @@ public function lfAddTotalLine($arrResults) // 合計の計算 foreach ($arrResults as $arrResult) { foreach ($arrResult as $key => $value) { - $arrTotal[$key] += $arrResult[$key]; + $arrTotal[$key] += (int) $arrResult[$key]; } } // 平均値の計算 From 3bcfdc7fb94ff542ccf1be74c24b08c19b0094cc Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Tue, 2 Jul 2019 22:06:47 +0900 Subject: [PATCH 06/11] Fix Cannot declare class Autoloading_SC_Product --- tests/class/plugin/LoadClassFileChangeTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/class/plugin/LoadClassFileChangeTest.php b/tests/class/plugin/LoadClassFileChangeTest.php index 803d81bcbd..db88a77791 100644 --- a/tests/class/plugin/LoadClassFileChangeTest.php +++ b/tests/class/plugin/LoadClassFileChangeTest.php @@ -9,10 +9,6 @@ protected function setUp() { parent::setUp(); $this->createPlugin(); - if (PHP_VERSION_ID < 70200) { - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance(); - $objPlugin->load(); - } } protected function tearDown() From e5671a153918d165e3e496d361de82b698a82758 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Tue, 2 Jul 2019 22:20:50 +0900 Subject: [PATCH 07/11] Fix createOrder --- tests/class/fixtures/FixtureGenerator.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/class/fixtures/FixtureGenerator.php b/tests/class/fixtures/FixtureGenerator.php index c8e3579e4c..37cd5f6fdb 100644 --- a/tests/class/fixtures/FixtureGenerator.php +++ b/tests/class/fixtures/FixtureGenerator.php @@ -646,12 +646,16 @@ public function createOrder($customer_id = 0, $product_class_ids = [], $deliv_id $order_id = $this->objQuery->nextVal('dtb_order_order_id'); if (empty($product_class_ids)) { + $where = 'product_type_id = 1 AND del_flg = 0 AND EXISTS (SELECT * FROM dtb_products WHERE del_flg = 0 AND product_id = dtb_products_class.product_id)'; + if ($this->objQuery->count('dtb_products_class', $where) < 1) { + $this->createProduct(); + } // 既存の商品規格から選択する $this->objQuery->setLimit(3); $product_class_ids = $this->objQuery->getCol( 'product_class_id', 'dtb_products_class', - 'product_type_id = 1 AND del_flg = 0 AND EXISTS (SELECT * FROM dtb_products WHERE del_flg = 0 AND product_id = dtb_products_class.product_id)'); + $where); } $orderDetails = array_map(function ($product_class_id) use ($order_id) { From b99394a766299dc9fad3212433d03d792955492b Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 3 Jul 2019 10:21:25 +0900 Subject: [PATCH 08/11] =?UTF-8?q?EMAIL=5FCHAR=5FCHECK=20=E3=81=AE=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=8C=E6=99=82=E6=8A=98=E8=90=BD=E3=81=A1?= =?UTF-8?q?=E3=82=8B=E5=8E=9F=E5=9B=A0=E8=AA=BF=E6=9F=BB=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SC_CheckError/SC_CheckError_EMAIL_CHAR_CHECKTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/class/SC_CheckError/SC_CheckError_EMAIL_CHAR_CHECKTest.php b/tests/class/SC_CheckError/SC_CheckError_EMAIL_CHAR_CHECKTest.php index f5237ec2ec..6e051be264 100644 --- a/tests/class/SC_CheckError/SC_CheckError_EMAIL_CHAR_CHECKTest.php +++ b/tests/class/SC_CheckError/SC_CheckError_EMAIL_CHAR_CHECKTest.php @@ -51,12 +51,13 @@ public function testEMAIL_CHAR_CHECKWithRegex() public function testEMAIL_CHAR_CHECKWithError() { + $email = $this->faker->randomNumber().'='.$this->faker->userName.'@'.$this->faker->safeEmailDomain; $this->arrForm = [ - self::FORM_NAME => $this->faker->randomNumber().'='.$this->faker->userName.'@'.$this->faker->safeEmailDomain + self::FORM_NAME => $email ]; $this->expected = '※ EMAIL_CHAR_CHECKに使用する文字を正しく入力してください。
        '; $this->scenario(); - $this->verify(); + $this->verify($email.' は使用できないパターンが含まれているはず'); } } From fbe604b07d3e6711763095eee641c21b03b72869 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 3 Jul 2019 11:20:07 +0900 Subject: [PATCH 09/11] Fix generating orders --- ctests/acceptance/_bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctests/acceptance/_bootstrap.php b/ctests/acceptance/_bootstrap.php index 47e5c93f04..fc11424bf0 100644 --- a/ctests/acceptance/_bootstrap.php +++ b/ctests/acceptance/_bootstrap.php @@ -52,7 +52,7 @@ if ($num < $config['fixture_order_num']) { echo 'Generating Orders'; foreach ($customer_ids as $customer_id) { - $target_product_class_ids = $product_class_ids[$faker->numberBetween(0, count($product_class_ids) - 1)]; + $target_product_class_ids = array_rand($product_class_ids, $faker->numberBetween(0, count($product_class_ids) - 1)); $charge = $faker->randomNumber(4); $discount = $faker->numberBetween(0, $charge); $order_count_per_customer = $objQuery->count('dtb_order', 'customer_id = ?', [$customer_id]); From f613ee093bf24daa58658d43bde5411913728e02 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 3 Jul 2019 11:27:59 +0900 Subject: [PATCH 10/11] Fix generator --- ctests/acceptance/_bootstrap.php | 4 ++-- tests/class/fixtures/FixtureGenerator.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ctests/acceptance/_bootstrap.php b/ctests/acceptance/_bootstrap.php index fc11424bf0..e9b5b7e1a6 100644 --- a/ctests/acceptance/_bootstrap.php +++ b/ctests/acceptance/_bootstrap.php @@ -40,7 +40,7 @@ $category_ids = $objGenerator->createCategories(); foreach ($product_ids as $product_id) { - $objGenerator->relateProductCategories($product_id, array_rand($category_ids, $faker->numberBetween(1, count($category_ids) - 1))); + $objGenerator->relateProductCategories($product_id, array_rand(array_flip($category_ids), $faker->numberBetween(2, count($category_ids) - 1))); } $objDb = new SC_Helper_DB_Ex(); $objDb->sfCountCategory($objQuery); @@ -52,7 +52,7 @@ if ($num < $config['fixture_order_num']) { echo 'Generating Orders'; foreach ($customer_ids as $customer_id) { - $target_product_class_ids = array_rand($product_class_ids, $faker->numberBetween(0, count($product_class_ids) - 1)); + $target_product_class_ids = array_rand(array_flip($product_class_ids), $faker->numberBetween(2, count($product_class_ids) - 1)); $charge = $faker->randomNumber(4); $discount = $faker->numberBetween(0, $charge); $order_count_per_customer = $objQuery->count('dtb_order', 'customer_id = ?', [$customer_id]); diff --git a/tests/class/fixtures/FixtureGenerator.php b/tests/class/fixtures/FixtureGenerator.php index 37cd5f6fdb..eb221daab1 100644 --- a/tests/class/fixtures/FixtureGenerator.php +++ b/tests/class/fixtures/FixtureGenerator.php @@ -412,6 +412,12 @@ public function createCategories($max_depth = 5, $max_generations = 30) } } + if (empty($result)) { + // カテゴリが生成されなかったら生成しておく + $id = $objQuery->nextVal('dtb_category_category_id'); + $result[] = $this->createCategory($id, 0, 1); + } + return $result; } From 12e345c3dc472aacf9afb952433a4a8cb022ccbd Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Wed, 24 Jul 2019 16:13:42 +0900 Subject: [PATCH 11/11] Fix warning --- data/class/pages/admin/total/LC_Page_Admin_Total.php | 2 +- data/class/pages/contact/LC_Page_Contact.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/class/pages/admin/total/LC_Page_Admin_Total.php b/data/class/pages/admin/total/LC_Page_Admin_Total.php index 3bb843ffc3..dd4bee2247 100644 --- a/data/class/pages/admin/total/LC_Page_Admin_Total.php +++ b/data/class/pages/admin/total/LC_Page_Admin_Total.php @@ -167,7 +167,7 @@ public function lfGetDateDefault() $month = date('m'); $day = date('d'); - $list = isset($_SESSION['total']) ? $_SESSION['total'] : ''; + $list = isset($_SESSION['total']) ? $_SESSION['total'] : []; // セッション情報に開始月度が保存されていない。 if (empty($_SESSION['total']['startyear_m'])) { diff --git a/data/class/pages/contact/LC_Page_Contact.php b/data/class/pages/contact/LC_Page_Contact.php index c6b6af122c..3905f95bef 100644 --- a/data/class/pages/contact/LC_Page_Contact.php +++ b/data/class/pages/contact/LC_Page_Contact.php @@ -77,7 +77,7 @@ public function action() { $objFormParam = new SC_FormParam_Ex(); - $this->arrData = isset($_SESSION['customer']) ? $_SESSION['customer'] : ''; + $this->arrData = isset($_SESSION['customer']) ? $_SESSION['customer'] : []; switch ($this->getMode()) { case 'confirm':