Ticket #1943 (closed バグ指摘: 修正済)

Opened 12 years ago

Last modified 11 years ago

SC_ClassAutoloader でのクラスの存在チェック

Reported by: nanasess Owned by: nanasess
Priority: Milestone: EC-CUBE2.13.0
Component: その他 Version: 2.12.2
Keywords: Cc:
修正済み: yes

Description

SC_ClassAutoloader にて include する際, クラスの存在チェックが無い.

プラグインの中に同梱させた外部ライブラリで spl_autoload_register() を使用していると, SC_ClassAutoloader 内の spl_autoload_register() が先にコールされるため, 外部ライブラリ内のクラスを見つけられずエラーとなってしまう

Change History

comment:1 Changed 11 years ago by kim

  • Milestone changed from EC-CUBE2.12.3 to EC-CUBE2.12.4

comment:2 Changed 11 years ago by nanasess

  • Owner changed from somebody to nanasess
  • Status changed from new to assigned

とり急ぎ、パッチを作成してみました。

diff --git a/ec-site/data/class/SC_ClassAutoloader.php b/ec-site/data/class/SC_ClassAutoloader.php
index 016080cf0f0f455e82db604107e063a0a95fa701 100644
--- a/ec-site/data/class/SC_ClassAutoloader.php
+++ b/ec-site/data/class/SC_ClassAutoloader.php
@@ -117,6 +117,16 @@
                 }
             }
         }
-        include $classpath;
+        if (file_exists($classpath)) {
+            include $classpath;
+        } else {
+            $arrPath = explode(PATH_SEPARATOR, get_include_path());
+            foreach ($arrPath as $path) {
+                if (file_exists($path . '/' .$classpath)) {
+                    include $classpath;
+                    break;
+                }
+            }
+        }
     }
 }

comment:3 Changed 11 years ago by nanasess

  • 修正済み set

r23028 で対応しました

comment:4 Changed 11 years ago by h_yoshimoto

  • Status changed from assigned to closed
  • Resolution set to 修正済

ご対応ありがとうございました。
こちらクローズさせていただきます。

Note: See TracTickets for help on using tickets.