From af2aa0caf2b400bcfca8b7d62d6df9c00da843c5 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 19 Mar 2003 13:57:40 +0000 Subject: [PATCH] fixed more bugs, obviously. git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3678 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/usercp_register.php | 11 +++++++---- phpBB/privmsg.php | 2 +- phpBB/templates/subSilver/posting_body.tpl | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8c91666f58..e62833ed13 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -97,6 +97,7 @@ p,ul,td {font-size:10pt;}
  • Added GMT + 13 to English lang_main, all translators are encouraged to do likewise - within the last release a language variable was missing
  • Deleted doubled 'U_MEMBERLIST' assignment from page_header.php
  • Fixed wrong display of Signature Checkbox while editing Private Message
  • +
  • Fixed disappearing post text if emoticon was inserted directly after pressing a BBCode button
  • 1.ii. Changes since 2.0.3

    diff --git a/phpBB/includes/usercp_register.php b/phpBB/includes/usercp_register.php index 241a248902..096bdd539d 100644 --- a/phpBB/includes/usercp_register.php +++ b/phpBB/includes/usercp_register.php @@ -27,6 +27,9 @@ if ( !defined('IN_PHPBB') ) exit; } +$unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#'); +$unhtml_specialchars_replace = array('>', '<', '"', '&'); + // --------------------------------------- // Load agreement template since user has not yet // agreed to registration conditions/coppa @@ -463,7 +466,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->assign_vars(array( 'SITENAME' => $board_config['sitename'], - 'USERNAME' => $username, + 'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $username), 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('
    ', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey) @@ -574,7 +577,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->assign_vars(array( 'SITENAME' => $board_config['sitename'], 'WELCOME_MSG' => sprintf($lang['Welcome_subject'], $board_config['sitename']), - 'USERNAME' => $username, + 'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $username), 'PASSWORD' => $password_confirm, 'EMAIL_SIG' => str_replace('
    ', "\n", "-- \n" . $board_config['board_email_sig']), @@ -596,7 +599,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->assign_vars(array( 'SITENAME' => $board_config['sitename'], 'WELCOME_MSG' => sprintf($lang['Welcome_subject'], $board_config['sitename']), - 'USERNAME' => $username, + 'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $username), 'PASSWORD' => $password_confirm, 'EMAIL_SIG' => str_replace('
    ', "\n", "-- \n" . $board_config['board_email_sig']), @@ -632,7 +635,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->extra_headers($email_headers . "Bcc: $bcc_list\n"); $emailer->assign_vars(array( - 'USERNAME' => $username, + 'USERNAME' => preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $username), 'EMAIL_SIG' => str_replace('
    ', "\n", "-- \n" . $board_config['board_email_sig']), 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey) diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php index 7c5d0e3d85..986c33521e 100644 --- a/phpBB/privmsg.php +++ b/phpBB/privmsg.php @@ -1455,7 +1455,7 @@ else if ( $submit || $refresh || $mode != '' ) $privmsg_message = str_replace('
    ', "\n", $privmsg_message); $privmsg_message = preg_replace('##si', '</textarea>', $privmsg_message); - $user_sig = ( $board_config['allow_sig'] ) ? (($privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL && %) ? $user_sig : $privmsg['user_sig']) : ''; + $user_sig = ( $board_config['allow_sig'] ) ? (($privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL) ? $user_sig : $privmsg['user_sig']) : ''; $to_username = $privmsg['username']; $to_userid = $privmsg['user_id']; diff --git a/phpBB/templates/subSilver/posting_body.tpl b/phpBB/templates/subSilver/posting_body.tpl index 701aebda22..a89e160783 100644 --- a/phpBB/templates/subSilver/posting_body.tpl +++ b/phpBB/templates/subSilver/posting_body.tpl @@ -96,7 +96,7 @@ function emoticon(text) { text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; - caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; + caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text;