diff options
author | 2013-02-25 10:39:07 +0000 | |
---|---|---|
committer | 2013-02-25 10:39:07 +0000 | |
commit | 2805a15f021b15502561f3beed8314186bacaf6a (patch) | |
tree | 7246388bfc73e98815cdfc6a4cda8337cccc5ce2 | |
parent | Script to retire devs on the forums (diff) | |
download | forums-2805a15f021b15502561f3beed8314186bacaf6a.tar.gz forums-2805a15f021b15502561f3beed8314186bacaf6a.tar.bz2 forums-2805a15f021b15502561f3beed8314186bacaf6a.zip |
ensure code is compatible with php 5.4
-rw-r--r-- | docs/ChangeLog | 6 | ||||
-rw-r--r-- | htdocs/common.php | 23 | ||||
-rw-r--r-- | htdocs/includes/usercp_register.php | 6 |
3 files changed, 25 insertions, 10 deletions
diff --git a/docs/ChangeLog b/docs/ChangeLog index 11a6ee21a..71be4d504 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -1,4 +1,10 @@ phpBB-2-0-23-gentoo-p7 (2013-01-20) + +- ensure code is compatible with php 5.4 (tomk) + +------------------------------------------------------------------------------- + +phpBB-2-0-23-gentoo-p7 (2013-01-20) - trigger watched user e-mail when profile is edited (tomk) - trigger watched user e-mail when posts are edited (tomk) - prevent piwik mixed content warnings when using https with javascript disabled (tomk) diff --git a/htdocs/common.php b/htdocs/common.php index 0dea803ec..e405248e9 100644 --- a/htdocs/common.php +++ b/htdocs/common.php @@ -6,7 +6,7 @@ * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * - * $Id: common.php,v 1.9 2009/07/30 06:38:50 desultory Exp $ + * $Id: common.php,v 1.10 2011/06/25 08:41:20 desultory Exp $ * ***************************************************************************/ @@ -26,14 +26,16 @@ if ( !defined('IN_PHPBB') ) // error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables -set_magic_quotes_runtime(0); // Disable magic_quotes_runtime +// 2013-02-25 tomk - set_magic_quotes_runtime() raises an E_CORE_ERROR in php 5.4 +//set_magic_quotes_runtime(0); // Disable magic_quotes_runtime // The following code (unsetting globals) // Thanks to Matt Kavanagh and Stefan Esser for providing feedback as well as patch files // PHP5 with register_long_arrays off? -if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off')) -{ +// 2013-02-25 tomk - register_globals and register_long_arrays php.ini directives have been removed in php 5.4 +//if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off')) +//{ $HTTP_POST_VARS = $_POST; $HTTP_GET_VARS = $_GET; $HTTP_SERVER_VARS = $_SERVER; @@ -46,7 +48,7 @@ if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get(' { $HTTP_SESSION_VARS = $_SESSION; } -} +//} // Protect against GLOBALS tricks if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS'])) @@ -60,6 +62,8 @@ if (isset($HTTP_SESSION_VARS) && !is_array($HTTP_SESSION_VARS)) die("Hacking attempt"); } +// 2013-02-25 tomk - register_globals and register_long_arrays php.ini directives have been removed in php 5.4 +/* if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') { // PHP4+ path @@ -95,14 +99,17 @@ if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals unset($input); } +*/ // // addslashes to vars if magic_quotes_gpc is off // this is a security precaution to prevent someone // trying to break out of a SQL statement. // -if( !get_magic_quotes_gpc() ) -{ +// 2013-02-25 tomk - get_magic_quotes_gpc always returns FALSE as of php 5.4 +// so lets get rid of this call now as I guess they'll deprecate it at some point +//if( !get_magic_quotes_gpc() ) +//{ if( is_array($HTTP_GET_VARS) ) { while( list($k, $v) = each($HTTP_GET_VARS) ) @@ -162,7 +169,7 @@ if( !get_magic_quotes_gpc() ) } @reset($HTTP_COOKIE_VARS); } -} +//} // // Define some basic configuration arrays this also prevents diff --git a/htdocs/includes/usercp_register.php b/htdocs/includes/usercp_register.php index 7fa5bc896..62c94e542 100644 --- a/htdocs/includes/usercp_register.php +++ b/htdocs/includes/usercp_register.php @@ -6,7 +6,7 @@ * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * - * $Id: usercp_register.php,v 1.41 2012/09/05 02:53:21 desultory Exp $ + * $Id: usercp_register.php,v 1.42 2013/01/12 13:48:20 tomk Exp $ * * ***************************************************************************/ @@ -1244,7 +1244,9 @@ if( isset($HTTP_POST_VARS['avatargallery']) && !$error ) // 2005-06-28 tomk - jabber diff++ // 2005-09-07 ian! - adding user_showavatars - display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $jabber, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id'],$user_showavatars); + // 2013-02-25 tomk - call-time pass by reference has been removed in php 5.4 + //display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $jabber, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id'],$user_showavatars); + display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $new_password, $cur_password, $password_confirm, $icq, $aim, $msn, $yim, $jabber, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id'],$user_showavatars); } else { |