From 2f4a618900e2c3b6ea14c68cbeb5897cd2ac1a04 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 29 May 2008 12:25:56 +0000 Subject: 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 --- phpBB/develop/generate_utf_tables.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'phpBB/develop/generate_utf_tables.php') diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php index 3d5188163d..fcf6395b24 100644 --- a/phpBB/develop/generate_utf_tables.php +++ b/phpBB/develop/generate_utf_tables.php @@ -25,8 +25,8 @@ die("Please read the first lines of this script for instructions on how to enabl set_time_limit(0); define('IN_PHPBB', true); -$phpbb_root_path = '../'; -$phpEx = substr(strrchr(__FILE__, '.'), 1); +define('PHPBB_ROOT_PATH', './../'); +define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); echo "Checking for required files\n"; download('http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt'); @@ -34,7 +34,7 @@ download('http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt'); download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt'); echo "\n"; -require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); +require_once(PHPBB_ROOT_PATH . 'includes/utf/utf_normalizer.' . PHP_EXT); $file_contents = array(); /** @@ -172,7 +172,7 @@ fclose($fp); * Do mappings */ echo "Loading Unicode decomposition mappings\n"; -$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt'); +$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt'); $map = array(); while (!feof($fp)) @@ -266,9 +266,9 @@ foreach ($file_contents as $file => $contents) /** * Generate a new file */ - echo "Writing to $file.$phpEx\n"; + echo "Writing to $file." . PHP_EXT . "\n"; - if (!$fp = fopen($phpbb_root_path . 'includes/utf/data/' . $file . '.' . $phpEx, 'wb')) + if (!$fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/' . $file . '.' . PHP_EXT, 'wb')) { trigger_error('Cannot open ' . $file . ' for write'); } @@ -288,7 +288,7 @@ echo "\n*** UTF-8 normalization tables done\n\n"; */ echo "Generating search indexer tables\n"; -$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt'); +$fp = fopen(PHPBB_ROOT_PATH . 'develop/UnicodeData.txt', 'rt'); $map = array(); while ($line = fgets($fp, 1024)) @@ -406,8 +406,8 @@ unset($map); foreach ($file_contents as $idx => $contents) { - echo "Writing to search_indexer_$idx.$phpEx\n"; - $fp = fopen($phpbb_root_path . 'includes/utf/data/search_indexer_' . $idx . '.' . $phpEx, 'wb'); + echo "Writing to search_indexer_$idx." . PHP_EXT . "\n"; + $fp = fopen(PHPBB_ROOT_PATH . 'includes/utf/data/search_indexer_' . $idx . '.' . PHP_EXT, 'wb'); fwrite($fp, '