Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SC_Helper_Customer::sfGetCustomerData() 一致無しを考慮していない #117

Closed
seasoftjapan opened this issue Feb 3, 2017 · 1 comment
Labels
Milestone

Comments

@seasoftjapan
Copy link
Contributor

中途半端な配列が返る。
false を返すとか、例外投げるとかすべき。

@@ -239,15 +239,17 @@ class SC_Helper_Customer
      * @param mixed $customer_id
      * @param boolean $mask_flg
      * @access public
-     * @return array 会員情報の配列を返す
+     * @return array|boolean 会員情報の配列を返す。該当する会員が存在しない場合、false を返する。
      */
     public function sfGetCustomerData($customer_id, $mask_flg = true)
     {
         $objQuery       =& SC_Query_Ex::getSingletonInstance();

         // 会員情報DB取得
-        $ret        = $objQuery->select('*', 'dtb_customer', 'customer_id=?', array($customer_id));
-        $arrForm    = $ret[0];
+        $arrForm = $objQuery->getRow('*', 'dtb_customer', 'customer_id=?', array($customer_id));
+        if (empty($arrForm)) {
+            return false;
+        }

         // 確認項目に複製
         $arrForm['email02'] = $arrForm['email'];

sfGetCustomerDataFromId() も似た状況だと思うが、empty な何か (null ?) が返りそう。(動作未確認) まだ、マシか。

@Yangsin Yangsin added this to the eccube-2.13.6 milestone Feb 10, 2017
@so-amuamu so-amuamu modified the milestones: eccube-2.13.6, 2.17.0 Jul 31, 2018
@so-amuamu
Copy link

実害は現状でも無いと見られるが、 #118 の対応と共に修正したい

kiy0taka added a commit that referenced this issue Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants