diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2008-05-29 12:25:56 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-05-29 12:25:56 +0000 |
commit | 2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04 (patch) | |
tree | 3b7ea329bf35eab5ddab9b0b5eb790e45e283a5c /phpBB/common.php | |
parent | 91b4fe1868ca2c4d81111943f781e3cfd0262ef2 (diff) | |
download | forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.tar forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.tar.gz forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.tar.bz2 forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.tar.xz forums-2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04.zip |
ok... i hope i haven't messed too much with the code and everything is still working.
Changes:
- Ascraeus now uses constants for the phpbb root path and the php extension. This ensures more security for external applications and modifications (no more overwriting of root path and extension possible through insecure mods and register globals enabled) as well as no more globalizing needed.
- A second change implemented here is an additional short-hand-notation for append_sid(). It is allowed to omit the root path and extension now (for example calling append_sid('memberlist')) - in this case the root path and extension get added automatically. The hook is called after these are added.
git-svn-id: file:///svn/phpbb/trunk@8572 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/common.php')
-rw-r--r-- | phpBB/common.php | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index 285bc3a7ad..de4d41beae 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -117,15 +117,15 @@ else if (defined('IN_CRON')) { - $phpbb_root_path = dirname(__FILE__) . DIRECTORY_SEPARATOR; + @define('PHPBB_ROOT_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR); } -if (!file_exists($phpbb_root_path . 'config.' . $phpEx)) +if (!file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT)) { - die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>"); + die('<p>The config.' . PHP_EXT . ' file could not be found.</p><p><a href="' . PHPBB_ROOT_PATH . 'install/index.' . PHP_EXT . '">Click here to install phpBB</a></p>'); } -require($phpbb_root_path . 'config.' . $phpEx); +require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT); if (!defined('PHPBB_INSTALLED')) { @@ -144,7 +144,7 @@ if (!defined('PHPBB_INSTALLED')) // Replace any number of consecutive backslashes and/or slashes with a single slash // (could happen on some proxy setups and/or Windows servers) - $script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx; + $script_path = trim(dirname($script_name)) . '/install/index.' . PHP_EXT; $script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path); $url = (($secure) ? 'https://' : 'http://') . $server_name; @@ -184,18 +184,18 @@ if (!empty($load_extensions)) } // Include files -require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); -require($phpbb_root_path . 'includes/cache.' . $phpEx); -require($phpbb_root_path . 'includes/template.' . $phpEx); -require($phpbb_root_path . 'includes/session.' . $phpEx); -require($phpbb_root_path . 'includes/auth.' . $phpEx); +require(PHPBB_ROOT_PATH . 'includes/acm/acm_' . $acm_type . '.' . PHP_EXT); +require(PHPBB_ROOT_PATH . 'includes/cache.' . PHP_EXT); +require(PHPBB_ROOT_PATH . 'includes/template.' . PHP_EXT); +require(PHPBB_ROOT_PATH . 'includes/session.' . PHP_EXT); +require(PHPBB_ROOT_PATH . 'includes/auth.' . PHP_EXT); -require($phpbb_root_path . 'includes/functions.' . $phpEx); -require($phpbb_root_path . 'includes/functions_content.' . $phpEx); +require(PHPBB_ROOT_PATH . 'includes/functions.' . PHP_EXT); +require(PHPBB_ROOT_PATH . 'includes/functions_content.' . PHP_EXT); -require($phpbb_root_path . 'includes/constants.' . $phpEx); -require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); -require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); +require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT); +require(PHPBB_ROOT_PATH . 'includes/db/' . $dbms . '.' . PHP_EXT); +require(PHPBB_ROOT_PATH . 'includes/utf/utf_tools.' . PHP_EXT); // Set PHP error handler to ours set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); @@ -217,12 +217,12 @@ unset($dbpasswd); $config = cache::obtain_config(); // Add own hook handler -require($phpbb_root_path . 'includes/hooks/index.' . $phpEx); +require(PHPBB_ROOT_PATH . 'includes/hooks/index.' . PHP_EXT); $phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display'))); foreach (cache::obtain_hooks() as $hook) { - @include($phpbb_root_path . 'includes/hooks/' . $hook . '.' . $phpEx); + @include(PHPBB_ROOT_PATH . 'includes/hooks/' . $hook . '.' . PHP_EXT); } ?>
\ No newline at end of file |