Ticket #1943 (closed バグ指摘: 修正済)
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: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; + } + } + } } }
Note: See
TracTickets for help on using
tickets.