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_FormParam をグローバルでインスタンス化すると E_WARNING が出力される #1027

Open
nanasess opened this issue Oct 11, 2024 · 0 comments

Comments

@nanasess
Copy link
Contributor

決済モジュールや独自カスタマイズで再現する
https://xoops.ec-cube.net/modules/newbb/viewtopic.php?viewmode=thread&order=ASC&topic_id=28581&forum=2

以下のパッチで解消する

diff --git a/data/class/SC_FormParam.php b/data/class/SC_FormParam.php
index 8d197669c..9c827a620 100644
--- a/data/class/SC_FormParam.php
+++ b/data/class/SC_FormParam.php
@@ -69,7 +69,7 @@ class SC_FormParam
         // TODO: debug_backtrace以外にいい方法があれば良いが、一旦これで
         $backtraces = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, 2);
         // 呼び出し元のクラスを取得
-        $class = $backtraces[1]['class'];
+        $class = isset($backtraces[1]['class']) ? $backtraces[1]['class'] : null;
         $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance();
         if (is_object($objPlugin)) {
             $objPlugin->doAction('SC_FormParam_construct', [$class, $this]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant