today a problem related to file inclusion without an explicit path was reported: http://cmsimpleforum.com/viewtopic.php?f=10&t=5160. I have no clue for which reason the inclusion failed, but it might be better anyhow to use explicit relative paths:
So I suggest we should do so. I've reviewed all include(_once) and require(_once) directives and the following changes should suffice:http://de.php.net/manual/en/ini.core.php#ini.include-path wrote:However, it is more efficient to explicitly use include './file' than having PHP always check the current directory for every include.
Code: Select all
Index: cmsimple/login.php
===================================================================
--- cmsimple/login.php (revision 295)
+++ cmsimple/login.php (working copy)
@@ -27,7 +27,7 @@
if (preg_match('/login.php/i', sv('PHP_SELF')))
die('Access Denied');
-require 'PasswordHash.php';
+require $pth['folder']['cmsimple'] . 'PasswordHash.php';
$xh_hasher = new PasswordHash(8, true);
// for subsite solution - GE 20011-02
Index: plugins/filebrowser/classes/required_classes.php
===================================================================
--- plugins/filebrowser/classes/required_classes.php (revision 295)
+++ plugins/filebrowser/classes/required_classes.php (working copy)
@@ -5,6 +5,6 @@
*/
/* utf-8 marker: äöü */
-require_once "filebrowser_view.php";
-require_once "filebrowser.php";
+require_once $pth['folder']['plugin_classes'] . 'filebrowser_view.php';
+require_once $pth['folder']['plugin_classes'] . 'filebrowser.php';
?>
\ No newline at end of file
Index: plugins/filebrowser/editorbrowser.php
===================================================================
--- plugins/filebrowser/editorbrowser.php (revision 295)
+++ plugins/filebrowser/editorbrowser.php (working copy)
@@ -5,8 +5,8 @@
*/
/* utf-8 marker: äöü */
-require_once 'classes/filebrowser_view.php';
-require_once 'classes/filebrowser.php';
+require_once './classes/filebrowser_view.php';
+require_once './classes/filebrowser.php';
if (!isset($_SESSION)) { session_start(); }
@@ -114,7 +114,7 @@
- $jsFile = 'editorhooks/' . basename($_GET['editor']) . '/script.php';
+ $jsFile = './editorhooks/' . basename($_GET['editor']) . '/script.php';
$script = '';
if (file_exists($jsFile)) {
Index: plugins/meta_tags/index.php
===================================================================
--- plugins/meta_tags/index.php (revision 295)
+++ plugins/meta_tags/index.php (working copy)
@@ -21,10 +21,6 @@
if(!defined('PLUGINLOADER')) {
die('Plugin '. basename(dirname(__FILE__)) . ' requires a newer version of the Pluginloader. No direct access.');
}
-/**
- * Include language package
- */
-include_once "languages/".$sl.'.php';
/**
* Add used interests to router
Index: plugins/page_params/index.php
===================================================================
--- plugins/page_params/index.php (revision 295)
+++ plugins/page_params/index.php (working copy)
@@ -20,10 +20,6 @@
* Check if PLUGINLOADER is calling and die if not
*/
if(!defined('PLUGINLOADER_VERSION')){die('Plugin '. basename(dirname(__FILE__)) . ' requires a newer version of the Pluginloader. No direct access.');}
-/**
- * Include language package
- */
-include_once "languages/".$sl.'.php';
/**
* Add used interests to router
Christoph