diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS index e3f159728e..04887c2d66 100644 --- a/phpBB/docs/AUTHORS +++ b/phpBB/docs/AUTHORS @@ -14,12 +14,12 @@ phpBB Project Manager : theFinn (James Atkinson) phpBB Lead Developers : Acyd Burn (Meik Sievertsen) psoTFX (Paul S. Owen) [2001 - 09/2005] -phpBB Developers : DavidMJ (David M.) +phpBB Developers : Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - ] + DavidMJ (David M.) GrahamJE (Graham Eames) naderman (Nils Aderman) subBlue (Tom Beddard) - Ashe (Ludovic Arnaud) - [10/2002 - 11/2003] BartVB (Bart van Bragt) - [11/2000 - 03/2006] diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 92410f2c1c..0a2778defe 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -376,6 +376,71 @@ if (!function_exists('stripos')) } } +if (!function_exists('realpath')) +{ + /** + * Replacement for realpath if it is disabled + * This function is from the php manual by nospam at savvior dot com + */ + function phpbb_realpath($path) + { + $translated_path = getenv('PATH_TRANSLATED'); + + $translated_path = str_replace('\\', '/', $translated_path); + $translated_path = str_replace(basename(getenv('PATH_INFO')), '', $translated_path); + + $translated_path .= '/'; + + if ($path == '.' || $path == './') + { + return $translated_path; + } + + // now check for back directory + $translated_path .= $path; + + $dirs = explode('/', $translated_path); + + foreach ($dirs as $key => $value) + { + if ($value == '..') + { + $dirs[$key] = ''; + $dirs[$key - 2] = ''; + } + } + + $translated_path = ''; + + foreach($dirs as $key => $value) + { + if (strlen($value) > 0) + { + $translated_path .= $value . '/'; + } + } + + $translated_path = substr($translated_path, 0, strlen($translated_path) - 1); + + if (is_dir($translated_path) || is_file($translated_path)) + { + return $translated_path; + } + + return false; + } +} +else +{ + /** + * A wrapper for realpath + */ + function phpbb_realpath($path) + { + return realpath($path); + } +} + // functions used for building option fields /** @@ -1189,8 +1254,8 @@ function redirect($url) else { // Get the realpath of dirname - $root_dirs = explode('/', str_replace('\\', '/', realpath('./'))); - $page_dirs = explode('/', str_replace('\\', '/', realpath($pathinfo['dirname']))); + $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath('./'))); + $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($pathinfo['dirname']))); $intersection = array_intersect_assoc($root_dirs, $page_dirs); $root_dirs = array_diff_assoc($root_dirs, $intersection); @@ -2144,7 +2209,7 @@ function get_backtrace() $output = '
'; $backtrace = debug_backtrace(); - $path = realpath($phpbb_root_path); + $path = phpbb_realpath($phpbb_root_path); foreach ($backtrace as $number => $trace) { @@ -2226,8 +2291,8 @@ function msg_handler($errno, $msg_text, $errfile, $errline) if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) { // remove complete path to installation, with the risk of changing backslashes meant to be there - $errfile = str_replace(array(realpath($phpbb_root_path), '\\'), array('', '/'), $errfile); - $msg_text = str_replace(array(realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text); + $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile); + $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text); echo '[phpBB Debug] PHP Notice: in file ' . $errfile . ' on line ' . $errline . ': ' . $msg_text . '
' . "\n"; } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 736e626793..efc352f259 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -141,6 +141,10 @@ function user_add($user_row, $cp_data = false) 'user_type' => $user_row['user_type'], ); + /** + * @todo user_allow_email is not used anywhere. Think about removing it. + */ + // These are the additional vars able to be specified $additional_vars = array( 'user_permissions' => '', diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 184d701959..e6418416e0 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -67,8 +67,8 @@ class session $page_name = htmlspecialchars(basename($script_name)); // current directory within the phpBB root (for example: adm) - $root_dirs = explode('/', str_replace('\\', '/', realpath($root_path))); - $page_dirs = explode('/', str_replace('\\', '/', realpath('./'))); + $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($root_path))); + $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath('./'))); $intersection = array_intersect_assoc($root_dirs, $page_dirs); $root_dirs = array_diff_assoc($root_dirs, $intersection); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 43bb278207..d2814fa47d 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -100,7 +100,7 @@ $lang = array_merge($lang, array( 'COLOUR_SWATCH' => 'Colour swatch', 'CONFIRM' => 'Confirm', 'CONFIRM_CODE' => 'Confirmation code', - 'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as you see it in the image, it is case insensitive.', + 'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as you see it in the image, it is case insensitive. Please note that a zero does not exist.', 'CONFIRM_CODE_WRONG' => 'The confirmation code you entered was incorrect.', 'CONGRATULATIONS' => 'Congratulations to', 'CONNECTION_FAILED' => 'Connection failed',