diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 16 | ||||
-rwxr-xr-x | phpBB/includes/acp/acp_inactive.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 14 | ||||
-rw-r--r-- | phpBB/includes/functions_transfer.php | 14 | ||||
-rw-r--r-- | phpBB/includes/message_parser.php | 9 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_profile.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_resend.php | 2 |
7 files changed, 44 insertions, 19 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 92f8057676..d67cfba2f3 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -27,7 +27,12 @@ class acp_board $action = request_var('action', ''); $submit = (isset($_POST['submit'])) ? true : false; - // Validation types are: string, int, bool, rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable) + /** + * Validation types are: + * string, int, bool, + * script_path (absolute path in url - beginning with / and no trailing slash), + * rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable) + */ switch ($mode) { case 'settings': @@ -283,10 +288,11 @@ class acp_board 'ranks_path' => array('lang' => 'RANKS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), 'legend3' => 'SERVER_URL_SETTINGS', - 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true), - 'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), - 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true), + 'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), + 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'script_path' => array('lang' => 'SCRIPT_PATH', 'validate' => 'script_path', 'type' => 'text::255', 'explain' => true), ) ); break; diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 68eeaab5b4..84387b4f5c 100755 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -94,10 +94,8 @@ class acp_inactive include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); $messenger = new messenger(); - - $board_url = generate_board_url() . "/ucp.$phpEx?mode=activate"; - $usernames = array(); + do { $messenger->template('user_remind_inactive', $row['user_lang']); @@ -109,7 +107,7 @@ class acp_inactive $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($row['username']), 'REGISTER_DATE' => $user->format_date($row['user_regdate']), - 'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']) + 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']) ); $messenger->send($row['user_notify_type']); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3b0cd9a055..4c417cc03e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1451,6 +1451,7 @@ function generate_board_url($without_script_path = false) $server_protocol = ($config['server_protocol']) ? $config['server_protocol'] : (($config['cookie_secure']) ? 'https://' : 'http://'); $server_name = $config['server_name']; $server_port = (int) $config['server_port']; + $script_path = $config['script_path']; $url = $server_protocol . $server_name; } @@ -1459,6 +1460,8 @@ function generate_board_url($without_script_path = false) // Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection $cookie_secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; $url = (($cookie_secure) ? 'https://' : 'http://') . $server_name; + + $script_path = $user->page['root_script_path']; } if ($server_port && (($config['cookie_secure'] && $server_port <> 443) || (!$config['cookie_secure'] && $server_port <> 80))) @@ -1466,13 +1469,18 @@ function generate_board_url($without_script_path = false) $url .= ':' . $server_port; } - if ($without_script_path) + if (!$without_script_path) { - return $url; + $url .= $script_path; } // Strip / from the end - return $url . substr($user->page['root_script_path'], 0, -1); + if (substr($url, -1, 1) == '/') + { + $url = substr($url, 0, -1); + } + + return $url; } /** diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 4c47f99412..8c00f2b1dd 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -359,9 +359,12 @@ class ftp extends transfer */ function _chdir($dir = '') { - if (substr($dir, -1, 1) == '/') + if ($dir && $dir !== '/') { - $dir = substr($dir, 0, -1); + if (substr($dir, -1, 1) == '/') + { + $dir = substr($dir, 0, -1); + } } return @ftp_chdir($this->connection, $dir); @@ -585,9 +588,12 @@ class ftp_fsock extends transfer */ function _chdir($dir = '') { - if (substr($dir, -1, 1) == '/') + if ($dir && $dir !== '/') { - $dir = substr($dir, 0, -1); + if (substr($dir, -1, 1) == '/') + { + $dir = substr($dir, 0, -1); + } } return $this->_send_command('CWD', $dir); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 285b0d0649..ed6f69cf49 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -840,7 +840,14 @@ class bbcode_firstpass extends bbcode { global $config, $phpEx, $user; - $check_path = ($user->page['root_script_path'] != '/') ? substr($user->page['root_script_path'], 0, -1) : '/'; + if ($config['force_server_vars']) + { + $check_path = $config['script_path']; + } + else + { + $check_path = ($user->page['root_script_path'] != '/') ? substr($user->page['root_script_path'], 0, -1) : '/'; + } // Is the user trying to link to a php file in this domain and script path? if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false) diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 29055f0d89..cfd6f217c0 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -173,7 +173,7 @@ class ucp_profile $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($data['username']), - 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", + 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey") ); diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index fe5801b37d..c61859b3e2 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -113,7 +113,7 @@ class ucp_resend $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($user_row['username']), - 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", + 'U_USER_DETAILS' => generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}") ); |