Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/Lockon/improve/php7' into EC-CU…
Browse files Browse the repository at this point in the history
  • Loading branch information
seasoftjapan committed Jun 19, 2019
2 parents 3a2e571 + 3ac54e0 commit 3adb99e
Show file tree
Hide file tree
Showing 88 changed files with 6,518 additions and 379 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,4 @@ after_script:
# Cache folder, you can delete cache from Travis CI web interface
cache:
directories:
- data/vendor
- $HOME/.composer/cache vendor/
- $HOME/.composer/cache
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Set build version format here instead of in the admin panel.
version: 2.17-dev-{build}

image: Visual Studio 2017

clone_folder: C:\projects\eccube2

cache:
Expand Down Expand Up @@ -33,6 +35,8 @@ services:

# Install scripts. (runs after repo cloning)
install:
- docker pull nanasess/mailcatcher:windowsservercore
- docker run -d -p 1080:1080 -p 1025:1025 --name mailcatcher nanasess/mailcatcher:windowsservercore
- cinst -y OpenSSL.Light --version 1.1.1
- SET PATH=C:\Program Files\OpenSSL;%PATH%
- sc config wuauserv start= auto
Expand Down
6 changes: 5 additions & 1 deletion data/class/SC_CartSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ public function getPrevURL()
}

// キーが一致した商品の削除
/**
* @deprecated 本体では使用していないメソッドです
*/
public function delProductKey($keyname, $val, $productTypeId)
{
$max = $this->getMax($productTypeId);
Expand Down Expand Up @@ -352,7 +355,7 @@ public function adjustSessionProductsClass(&$arrProductsClass)
* @param integer $productTypeId 商品種別ID
* @param integer $key
* @return void
*
* @deprecated 本体では使用していないメソッドです
* MEMO: せっかく一回だけ読み込みにされてますが、税率対応の関係でちょっと保留
*/
public function setCartSession4getCartList($productTypeId, $key)
Expand Down Expand Up @@ -578,6 +581,7 @@ public function setQuantity($quantity, $cart_no, $productTypeId)
* @param integer $cart_no カート番号
* @param integer $productTypeId 商品種別ID
* @return integer 商品規格ID
* @deprecated 本体では使用していないメソッドです
*/
public function getProductClassId($cart_no, $productTypeId)
{
Expand Down
8 changes: 4 additions & 4 deletions data/class/SC_CheckError.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public function GREATER_CHECK($value)
$this->arrErr[$keyname1] = sprintf(
'※ %sは%sより大きい値を入力できません。<br />',
$disp_name1,
$disp_name1
$disp_name2
);
}
}
Expand Down Expand Up @@ -432,9 +432,9 @@ public function MIN_LENGTH_CHECK($value)
}

/**
* 最大文字数制限の判定
* 最大数制限の判定
*
* 入力が最大数以上ならエラーを返す
* 入力が最大数より大きければエラーを返す
* @param array $value value[0] = 項目名
* value[1] = 判定対象文字列
* value[2] = 最大数
Expand Down Expand Up @@ -1749,7 +1749,7 @@ public function createParam($value)
*
* @access private
* @param string $string チェックする文字列
* @return boolean 値が10進数の数値表現のみの場合 true
* @return boolean 値が10進数の数値表現以外の場合 true
*/
public function numelicCheck($string)
{
Expand Down
1 change: 1 addition & 0 deletions data/class/SC_Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function getCustomerDataFromEmailPass($pass, $email, $mobile = false)
* FIXME
* @return boolean 該当する会員が存在する場合は true、それ以外の場合
* は false を返す。
* @deprecated
*/
public function checkMobilePhoneId()
{
Expand Down
15 changes: 11 additions & 4 deletions data/class/SC_Initial.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,17 @@ public function phpconfigInit()
//ロケールを明示的に設定
$res = setlocale(LC_ALL, LOCALE);
if ($res === FALSE) {
// TODO: Windows上のロケール設定が正常に働かない場合があることに暫定的に対応
// ''を指定するとApache実行環境の環境変数が使われる
// See also: http://php.net/manual/ja/function.setlocale.php
setlocale(LC_ALL, '');
if ('\\' === DIRECTORY_SEPARATOR && PHP_VERSION_ID >= 70000) {
// Windows 版 PHP7 以降の fgetcsv 関数は、日本語のロケールで
// UTF-8 のファイルを正常にパースできないため、ロケールを英語に設定する
// see https://github.com/EC-CUBE/ec-cube/issues/1780#issuecomment-248557386
setlocale(LC_ALL, 'English_United States.1252');
} else {
// TODO: Windows上のロケール設定が正常に働かない場合があることに暫定的に対応
// ''を指定するとApache実行環境の環境変数が使われる
// See also: http://php.net/manual/ja/function.setlocale.php
setlocale(LC_ALL, '');
}
}

// #1849 (文字エンコーディングの検出を制御する)
Expand Down
1 change: 1 addition & 0 deletions data/class/SC_MobileEmoji.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

/**
* 携帯端末の絵文字を扱うクラス
* @deprecated
*/
class SC_MobileEmoji
{
Expand Down
1 change: 1 addition & 0 deletions data/class/SC_MobileImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

/**
* 画像変換クラス
* @deprecated
*/
class SC_MobileImage
{
Expand Down
10 changes: 5 additions & 5 deletions data/class/SC_MobileUserAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SC_MobileUserAgent
*/
public function getCarrier()
{
trigger_error(E_USER_DEPRECATED, 'Net_UserAgent_Mobile is deprecated');
trigger_error('Net_UserAgent_Mobile is deprecated', E_USER_DEPRECATED);
return false;
}

Expand All @@ -58,7 +58,7 @@ public function getCarrier()
*/
public function getId()
{
trigger_error(E_USER_DEPRECATED, 'Net_UserAgent_Mobile is deprecated');
trigger_error('Net_UserAgent_Mobile is deprecated', E_USER_DEPRECATED);
return false;
}

Expand All @@ -70,7 +70,7 @@ public function getId()
*/
public function getModel()
{
trigger_error(E_USER_DEPRECATED, 'Net_UserAgent_Mobile is deprecated');
trigger_error('Net_UserAgent_Mobile is deprecated', E_USER_DEPRECATED);
return false;
}

Expand All @@ -88,7 +88,7 @@ public function getModel()
*/
public function isSupported()
{
trigger_error(E_USER_DEPRECATED, 'Net_UserAgent_Mobile is deprecated');
trigger_error('Net_UserAgent_Mobile is deprecated', E_USER_DEPRECATED);
return false;
}

Expand All @@ -101,7 +101,7 @@ public function isSupported()
*/
public function isMobile()
{
trigger_error(E_USER_DEPRECATED, 'Net_UserAgent_Mobile is deprecated');
trigger_error('Net_UserAgent_Mobile is deprecated', E_USER_DEPRECATED);
return false;
}
}
3 changes: 3 additions & 0 deletions data/class/SC_MobileView.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

/**
* @deprecated
*/
class SC_MobileView extends SC_SiteView_Ex
{
public function __construct($setPrevURL = true)
Expand Down
4 changes: 2 additions & 2 deletions data/class/SC_Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public function findProductIdsOrder(&$objQuery, $arrVal = array())
$o_table = $this->arrOrderData['table'];
$o_order = $this->arrOrderData['order'];
$objQuery->setOrder("T2.$o_col $o_order");
$sub_sql = $objQuery->getSql($o_col, "$o_table AS T2", 'T2.product_id = alldtl.product_id');
$sub_sql = $objQuery->getSql($o_col, "$o_table AS T2", 'T2.product_id = alldtl.product_id AND T2.del_flg = 0');
$sub_sql = $objQuery->dbFactory->addLimitOffset($sub_sql, 1);

$objQuery->setOrder("($sub_sql) $o_order, product_id");
}
$arrReturn = $objQuery->getCol('alldtl.product_id', $table, '', $arrVal);
$arrReturn = $objQuery->getCol('alldtl.product_id', $table, $objQuery->where ? '' : 'alldtl.del_flg = 0', $arrVal);

return $arrReturn;
}
Expand Down
22 changes: 22 additions & 0 deletions data/class/SC_UploadFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ public function deleteFile($keyname)
}

// 画像を削除する。
/**
* @deprecated 本体で使用されていないため非推奨
*/
public function deleteKikakuFile($keyname)
{
$objImage = new SC_Image_Ex($this->temp_dir);
Expand Down Expand Up @@ -307,6 +310,9 @@ public function setHiddenFileList($arrPOST)
}
}

/**
* @deprecated 本体で使用されていないため非推奨
*/
public function setHiddenKikakuFileList($arrPOST)
{
$cnt = 0;
Expand Down Expand Up @@ -378,6 +384,10 @@ public function getFormDownFile()

return $arrRet;
}

/**
* @deprecated 本体で使用されていないため非推奨
*/
public function getFormKikakuDownFile()
{
$arrRet = array();
Expand Down Expand Up @@ -432,6 +442,9 @@ public function setDBDownFile($arrVal)
}

// DBで保存されたダウンロードファイル名をセットする(setDBDownFileと統合予定)
/**
* @deprecated 本体で使用されていないため非推奨
*/
public function setPostFileList($arrPost)
{
for ($cnt = 0;$cnt < count($this->keyname); $cnt++) {
Expand All @@ -442,6 +455,9 @@ public function setPostFileList($arrPost)
}

// 画像をセットする
/**
* @deprecated 本体で使用されていないため非推奨
*/
public function setDBImageList($arrVal)
{
$cnt = 0;
Expand All @@ -454,6 +470,9 @@ public function setDBImageList($arrVal)
}

// DB上のファイルの内削除要求があったファイルを削除する。
/**
* @deprecated 本体で使用されていないため非推奨
*/
public function deleteDBFile($arrVal)
{
$objImage = new SC_Image_Ex($this->temp_dir);
Expand Down Expand Up @@ -505,6 +524,9 @@ public function checkExists($keyname = '')
}

// 拡大率を指定して画像保存
/**
* @deprecated 本体で使用されていないため非推奨
*/
public function saveResizeImage($keyname, $to_w, $to_h)
{
$path = '';
Expand Down
15 changes: 0 additions & 15 deletions data/class/helper/SC_Helper_HandleError.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,6 @@ public static function displaySystemError($errstr = null)

ob_clean();

// 絵文字変換・除去フィルターが有効か評価する。
$loaded_ob_emoji = false;
$arrObs = ob_get_status(true);
foreach ($arrObs as $arrOb) {
if ($arrOb['name'] === 'SC_MobileEmoji::handler') {
$loaded_ob_emoji = true;
break;
}
}

// 絵文字変換・除去フィルターが無効で、利用できる場合、有効にする。
if (!$loaded_ob_emoji && class_exists('SC_MobileEmoji')) {
ob_start(array('SC_MobileEmoji', 'handler'));
}

require_once CLASS_EX_REALDIR . 'page_extends/error/LC_Page_Error_SystemError_Ex.php';
$objPage = new LC_Page_Error_SystemError_Ex();
$objPage->init();
Expand Down
1 change: 1 addition & 0 deletions data/class/helper/SC_Helper_Mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @package Helper
* @author EC-CUBE CO.,LTD.
* @version $Id$
* @deprecated
*/
class SC_Helper_Mobile
{
Expand Down
13 changes: 13 additions & 0 deletions data/class/pages/LC_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class LC_Page
*/
public function init()
{
$this->sendAdditionalHeader();
// 開始時刻を設定する。
$this->timeStart = microtime(true);

Expand Down Expand Up @@ -510,4 +511,16 @@ public function checkLimitPostMode()
trigger_error($msg, E_USER_ERROR);
}
}

/**
* 追加の HTTP ヘッダを送信する.
*
* 主にセキュリティ関連のヘッダを送信する.
*/
public function sendAdditionalHeader()
{
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: DENY');
}
}
1 change: 1 addition & 0 deletions data/class/pages/admin/LC_Page_Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class LC_Page_Admin extends LC_Page_Ex
*/
public function init()
{
$this->sendAdditionalHeader();
$this->template = MAIN_FRAME;

//IP制限チェック
Expand Down
10 changes: 10 additions & 0 deletions data/class/pages/admin/system/LC_Page_Admin_System_System.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,14 @@ public function getSystemInfo()

return $arrSystemInfo;
}

/**
* {@inheritdoc}
*/
public function sendAdditionalHeader()
{
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: SAMEORIGIN');
}
}
1 change: 1 addition & 0 deletions data/class/sessionfactory/SC_SessionFactory_UseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @package SC_SessionFactory
* @author EC-CUBE CO.,LTD.
* @version $Id$
* @deprecated
*/
class SC_SessionFactory_UseRequest extends SC_SessionFactory_Ex
{
Expand Down
1 change: 1 addition & 0 deletions data/include/image_converter.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* 画像ファイルの変換を行う
* @deprecated
*/
class ImageConverter
{
Expand Down
6 changes: 0 additions & 6 deletions html/.htaccess
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<ifModule mod_headers.c>
Header always set X-XSS-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set X-Frame-Options DENY
</ifModule>

# 基本は SC_Initial.php で設定するが、ini_setで反映されないものはここで設定する
<IfModule mod_php5.c>
php_value mbstring.language Japanese
Expand Down
11 changes: 0 additions & 11 deletions html/require.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,3 @@

require_once HTML_REALDIR . 'define.php';
require_once HTML_REALDIR . HTML2DATA_DIR . 'require_base.php';

// 絵文字変換 (除去) フィルターを組み込む。
ob_start(array('SC_MobileEmoji', 'handler'));

if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
// resize_image.phpは除外
if (stripos($_SERVER['REQUEST_URI'], ROOT_URLPATH . 'resize_image.php') === FALSE) {
$objMobile = new SC_Helper_Mobile_Ex();
$objMobile->sfMobileInit();
}
}
Loading

0 comments on commit 3adb99e

Please sign in to comment.