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

PREF_CHECK が未入力を許容していない #744

Open
seasoftjapan opened this issue Jun 29, 2023 · 0 comments · May be fixed by #1113
Open

PREF_CHECK が未入力を許容していない #744

seasoftjapan opened this issue Jun 29, 2023 · 0 comments · May be fixed by #1113
Assignees
Labels
Milestone

Comments

@seasoftjapan
Copy link
Contributor

実質 EXIST_CHECK を兼ねてしまっている気がする。

eccube2-weekly-20230404 をカスタマイズした環境で発覚した。素のソースでは検証していない。

修正案

--- data/class/SC_CheckError.php
+++ data/class/SC_CheckError.php
@@ -1804,6 +1804,12 @@ public function PREF_CHECK($value)
         $key = $value[1];
 
         $pref_id = $this->arrParam[$key];
+
+        // 未入力時はチェックしない。
+        if (strlen($pref_id) == 0) {
+            return;
+        }
+
         $objQuery = SC_Query_Ex::getSingletonInstance();
         $exists = $objQuery->exists('mtb_pref', 'id = ?', array($pref_id));
         if (!$exists) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants