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/cron.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/cron.php')
-rw-r--r-- | phpBB/cron.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/phpBB/cron.php b/phpBB/cron.php index 3993a149b5..3cba9e3f5e 100644 --- a/phpBB/cron.php +++ b/phpBB/cron.php @@ -12,9 +12,9 @@ */ define('IN_PHPBB', true); define('IN_CRON', true); -$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.' . $phpEx); +if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './'); +if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); +include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT); // Do not update users last page entry $user->session_begin(false); @@ -74,7 +74,7 @@ switch ($cron_type) { case 'queue': - if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists($phpbb_root_path . 'cache/queue.' . $phpEx)) + if (time() - $config['queue_interval'] <= $config['last_queue_run'] || !file_exists(PHPBB_ROOT_PATH . 'cache/queue.' . PHP_EXT)) { break; } @@ -85,7 +85,7 @@ switch ($cron_type) $use_shutdown_function = false; } - include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT); $queue = new queue(); if ($use_shutdown_function) @@ -122,12 +122,12 @@ switch ($cron_type) // Select the search method $search_type = basename($config['search_type']); - if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (time() - $config['search_gc'] <= $config['search_last_gc'] || !file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT)) { break; } - include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + include_once(PHPBB_ROOT_PATH . "includes/search/$search_type." . PHP_EXT); // We do some additional checks in the module to ensure it can actually be utilised $error = false; @@ -156,7 +156,7 @@ switch ($cron_type) break; } - include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT); if ($use_shutdown_function) { @@ -176,7 +176,7 @@ switch ($cron_type) break; } - include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT); if ($use_shutdown_function) { @@ -226,7 +226,7 @@ switch ($cron_type) // Do the forum Prune thang if ($row['prune_next'] < time() && $row['enable_prune']) { - include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + include_once(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT); if ($row['prune_days']) { |