1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-17 22:28:46 +01:00

Merge pull request #6377 from lionel-rowe/ticket/16981

[ticket/16981] Fix HTML-encoded emojis in email subject line
This commit is contained in:
Marc Alexander 2022-04-30 22:27:37 +02:00
commit 3308318524
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
55 changed files with 134 additions and 134 deletions

View File

@ -86,7 +86,7 @@ class acp_bbcodes
$display_on_posting = $request->variable('display_on_posting', 0);
$bbcode_match = $request->variable('bbcode_match', '');
$bbcode_tpl = htmlspecialchars_decode($request->variable('bbcode_tpl', '', true), ENT_COMPAT);
$bbcode_tpl = html_entity_decode($request->variable('bbcode_tpl', '', true), ENT_COMPAT);
$bbcode_helpline = $request->variable('bbcode_helpline', '', true);
break;
}

View File

@ -720,8 +720,8 @@ class acp_board
$messenger->set_addresses($user->data);
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user->data['username'], ENT_COMPAT),
'MESSAGE' => htmlspecialchars_decode($request->variable('send_test_email_text', '', true), ENT_COMPAT),
'USERNAME' => html_entity_decode($user->data['username'], ENT_COMPAT),
'MESSAGE' => html_entity_decode($request->variable('send_test_email_text', '', true), ENT_COMPAT),
));
$messenger->send(NOTIFY_EMAIL);

View File

@ -205,7 +205,7 @@ class acp_email
$email_template = 'admin_send_email';
$template_data = array(
'CONTACT_EMAIL' => phpbb_get_board_contact($config, $phpEx),
'MESSAGE' => htmlspecialchars_decode($message, ENT_COMPAT),
'MESSAGE' => html_entity_decode($message, ENT_COMPAT),
);
$generate_log_entry = true;
@ -252,7 +252,7 @@ class acp_email
$messenger->anti_abuse_headers($config, $user);
$messenger->subject(htmlspecialchars_decode($subject, ENT_COMPAT));
$messenger->subject(html_entity_decode($subject, ENT_COMPAT));
$messenger->set_mail_priority($priority);
$messenger->assign_vars($template_data);

View File

@ -90,7 +90,7 @@ class acp_help_phpbb
if (!empty($response))
{
$decoded_response = json_decode(htmlspecialchars_decode($response, ENT_COMPAT), true);
$decoded_response = json_decode(html_entity_decode($response, ENT_COMPAT), true);
if ($decoded_response && isset($decoded_response['status']) && $decoded_response['status'] == 'ok')
{

View File

@ -130,7 +130,7 @@ class acp_inactive
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username'], ENT_COMPAT))
'USERNAME' => html_entity_decode($row['username'], ENT_COMPAT))
);
$messenger->send(NOTIFY_EMAIL);
@ -224,7 +224,7 @@ class acp_inactive
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($row['username'], ENT_COMPAT),
'USERNAME' => html_entity_decode($row['username'], ENT_COMPAT),
'REGISTER_DATE' => $user->format_date($row['user_regdate'], false, true),
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
);

View File

@ -108,7 +108,7 @@ class acp_logs
$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
$keywords = $request->variable('keywords', '', true);
$keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords, ENT_COMPAT)) : '';
$keywords_param = !empty($keywords) ? '&keywords=' . urlencode(html_entity_decode($keywords, ENT_COMPAT)) : '';
$l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS'];
$l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN'];

View File

@ -70,7 +70,7 @@ class acp_ranks
'rank_title' => $rank_title,
'rank_special' => $special_rank,
'rank_min' => $min_posts,
'rank_image' => htmlspecialchars_decode($rank_image, ENT_COMPAT)
'rank_image' => html_entity_decode($rank_image, ENT_COMPAT)
);
/**

View File

@ -402,8 +402,8 @@ class acp_users
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => htmlspecialchars_decode($user_row['username'], ENT_COMPAT),
'WELCOME_MSG' => html_entity_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
);
@ -466,7 +466,7 @@ class acp_users
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username'], ENT_COMPAT))
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT))
);
$messenger->send(NOTIFY_EMAIL);

View File

@ -759,7 +759,7 @@ function phpbb_http_login($param)
{
if ($request->is_set($k, \phpbb\request\request_interface::SERVER))
{
$username = htmlspecialchars_decode($request->server($k), ENT_COMPAT);
$username = html_entity_decode($request->server($k), ENT_COMPAT);
break;
}
}
@ -769,7 +769,7 @@ function phpbb_http_login($param)
{
if ($request->is_set($k, \phpbb\request\request_interface::SERVER))
{
$password = htmlspecialchars_decode($request->server($k), ENT_COMPAT);
$password = html_entity_decode($request->server($k), ENT_COMPAT);
break;
}
}

View File

@ -803,8 +803,8 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class
$orig_url = $url;
$orig_relative = $relative_url;
$append = '';
$url = htmlspecialchars_decode($url, ENT_COMPAT);
$relative_url = htmlspecialchars_decode($relative_url, ENT_COMPAT);
$url = html_entity_decode($url, ENT_COMPAT);
$relative_url = html_entity_decode($relative_url, ENT_COMPAT);
// make sure no HTML entities were matched
$chars = array('<', '>', '"');
@ -1456,7 +1456,7 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al
$string = substr($string, 4);
}
$_chars = utf8_str_split(htmlspecialchars_decode($string, ENT_COMPAT));
$_chars = utf8_str_split(html_entity_decode($string, ENT_COMPAT));
$chars = array_map('utf8_htmlspecialchars', $_chars);
// Now check the length ;)
@ -1471,7 +1471,7 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al
if (utf8_strlen($string) > $max_store_length)
{
// let's split again, we do not want half-baked strings where entities are split
$_chars = utf8_str_split(htmlspecialchars_decode($string, ENT_COMPAT));
$_chars = utf8_str_split(html_entity_decode($string, ENT_COMPAT));
$chars = array_map('utf8_htmlspecialchars', $_chars);
do

View File

@ -208,7 +208,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
if (empty($user->browser) || ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($user->browser, 7)))
{
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'], ENT_COMPAT)));
header('Content-Disposition: attachment; ' . header_filename(html_entity_decode($attachment['real_filename'], ENT_COMPAT)));
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
{
header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
@ -216,7 +216,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
}
else
{
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'], ENT_COMPAT)));
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(html_entity_decode($attachment['real_filename'], ENT_COMPAT)));
if (phpbb_is_greater_ie_version($user->browser, 7) && (strpos($attachment['mimetype'], 'image') !== 0))
{
header('X-Download-Options: noopen');
@ -327,7 +327,7 @@ function download_allowed()
return true;
}
$url = htmlspecialchars_decode($request->header('Referer'), ENT_COMPAT);
$url = html_entity_decode($request->header('Referer'), ENT_COMPAT);
if (!$url)
{

View File

@ -320,8 +320,8 @@ class messenger
// We add some standard variables we always use, no need to specify them always
$this->assign_vars(array(
'U_BOARD' => generate_board_url(),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'], ENT_COMPAT)),
'SITENAME' => htmlspecialchars_decode($config['sitename'], ENT_COMPAT),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . html_entity_decode($config['board_email_sig'], ENT_COMPAT)),
'SITENAME' => html_entity_decode($config['sitename'], ENT_COMPAT),
));
$subject = $this->subject;
@ -427,7 +427,7 @@ class messenger
$user->session_begin();
}
$calling_page = htmlspecialchars_decode($request->server('PHP_SELF'), ENT_COMPAT);
$calling_page = html_entity_decode($request->server('PHP_SELF'), ENT_COMPAT);
switch ($type)
{
@ -557,7 +557,7 @@ class messenger
$use_queue = true;
}
$contact_name = htmlspecialchars_decode($config['board_contact_name'], ENT_COMPAT);
$contact_name = html_entity_decode($config['board_contact_name'], ENT_COMPAT);
$board_contact = (($contact_name !== '') ? '"' . mail_encode($contact_name) . '" ' : '') . '<' . $config['board_contact'] . '>';
$break = false;
@ -691,7 +691,7 @@ class messenger
if (!$use_queue)
{
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password'], ENT_COMPAT), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], html_entity_decode($config['jab_password'], ENT_COMPAT), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
if (!$this->jabber->connect())
{
@ -891,7 +891,7 @@ class queue
}
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password'], ENT_COMPAT), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], html_entity_decode($config['jab_password'], ENT_COMPAT), $config['jab_use_ssl'], $config['jab_verify_peer'], $config['jab_verify_peer_name'], $config['jab_allow_self_signed']);
if (!$this->jabber->connect())
{
@ -1208,7 +1208,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
}
// Let me in. This function handles the complete authentication process
if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], htmlspecialchars_decode($config['smtp_password'], ENT_COMPAT), $config['smtp_auth_method']))
if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], html_entity_decode($config['smtp_password'], ENT_COMPAT), $config['smtp_auth_method']))
{
$smtp->close_session($err_msg);
return false;

View File

@ -1575,11 +1575,11 @@ function validate_string($string, $optional = false, $min = 0, $max = 0)
return false;
}
if ($min && utf8_strlen(htmlspecialchars_decode($string, ENT_COMPAT)) < $min)
if ($min && utf8_strlen(html_entity_decode($string, ENT_COMPAT)) < $min)
{
return 'TOO_SHORT';
}
else if ($max && utf8_strlen(htmlspecialchars_decode($string, ENT_COMPAT)) > $max)
else if ($max && utf8_strlen(html_entity_decode($string, ENT_COMPAT)) > $max)
{
return 'TOO_LONG';
}

View File

@ -179,7 +179,7 @@ class mcp_logs
$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
$keywords = $request->variable('keywords', '', true);
$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords, ENT_COMPAT)) : '';
$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(html_entity_decode($keywords, ENT_COMPAT)) : '';
// Grab log data
$log_data = array();

View File

@ -206,7 +206,7 @@ class mcp_notes
$sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
$keywords = $request->variable('keywords', '', true);
$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords, ENT_COMPAT)) : '';
$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(html_entity_decode($keywords, ENT_COMPAT)) : '';
$log_data = array();
$log_count = 0;

View File

@ -506,7 +506,7 @@ class bbcode_firstpass extends bbcode
}
// Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results
$code = htmlspecialchars_decode($code, ENT_COMPAT);
$code = html_entity_decode($code, ENT_COMPAT);
$code = highlight_string($code, true);
$str_from = array('<span style="color: ', '<font color="syntax', '</font>', '<code>', '</code>','[', ']', '.', ':');
@ -1247,7 +1247,7 @@ class parse_message extends bbcode_firstpass
));
// Parse this message
$this->message = $parser->parse(htmlspecialchars_decode($this->message, ENT_QUOTES));
$this->message = $parser->parse(html_entity_decode($this->message, ENT_QUOTES));
// Remove quotes that are nested too deep
if ($config['max_quote_depth'] > 0)

View File

@ -150,11 +150,11 @@ class phpbb_questionnaire_system_data_provider
// Start discovering the IPV4 server address, if available
// Try apache, IIS, fall back to 0.0.0.0
$server_address = htmlspecialchars_decode($request->server('SERVER_ADDR', $request->server('LOCAL_ADDR', '0.0.0.0')), ENT_COMPAT);
$server_address = html_entity_decode($request->server('SERVER_ADDR', $request->server('LOCAL_ADDR', '0.0.0.0')), ENT_COMPAT);
return array(
'os' => PHP_OS,
'httpd' => htmlspecialchars_decode($request->server('SERVER_SOFTWARE'), ENT_COMPAT),
'httpd' => html_entity_decode($request->server('SERVER_SOFTWARE'), ENT_COMPAT),
// we don't want the real IP address (for privacy policy reasons) but only
// a network address to see whether your installation is running on a private or public network.
'private_ip' => $this->is_private_ip($server_address),

View File

@ -142,7 +142,7 @@ class ucp_activate
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username'], ENT_COMPAT))
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT))
);
$messenger->send($user_row['user_notify_type']);

View File

@ -186,7 +186,7 @@ class ucp_profile
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($data['username'], ENT_COMPAT),
'USERNAME' => html_entity_decode($data['username'], ENT_COMPAT),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
);

View File

@ -468,9 +468,9 @@ class ucp_register
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => htmlspecialchars_decode($data['username'], ENT_COMPAT),
'PASSWORD' => htmlspecialchars_decode($data['new_password'], ENT_COMPAT),
'WELCOME_MSG' => html_entity_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => html_entity_decode($data['username'], ENT_COMPAT),
'PASSWORD' => html_entity_decode($data['new_password'], ENT_COMPAT),
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
);

View File

@ -99,8 +99,8 @@ class ucp_resend
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => htmlspecialchars_decode($user_row['username'], ENT_COMPAT),
'WELCOME_MSG' => html_entity_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);
@ -134,7 +134,7 @@ class ucp_resend
$messenger->anti_abuse_headers($config, $user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username'], ENT_COMPAT),
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),
'U_USER_DETAILS' => generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$user_row['user_id']}",
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);

View File

@ -442,16 +442,16 @@ switch ($mode)
$messenger = new messenger(false);
$messenger->template('profile_send_im', $row['user_lang']);
$messenger->subject(htmlspecialchars_decode($subject, ENT_COMPAT));
$messenger->subject(html_entity_decode($subject, ENT_COMPAT));
$messenger->replyto($user->data['user_email']);
$messenger->set_addresses($row);
$messenger->assign_vars(array(
'BOARD_CONTACT' => phpbb_get_board_contact($config, $phpEx),
'FROM_USERNAME' => htmlspecialchars_decode($user->data['username'], ENT_COMPAT),
'TO_USERNAME' => htmlspecialchars_decode($row['username'], ENT_COMPAT),
'MESSAGE' => htmlspecialchars_decode($message, ENT_COMPAT))
'FROM_USERNAME' => html_entity_decode($user->data['username'], ENT_COMPAT),
'TO_USERNAME' => html_entity_decode($row['username'], ENT_COMPAT),
'MESSAGE' => html_entity_decode($message, ENT_COMPAT))
);
$messenger->send(NOTIFY_IM);
@ -804,8 +804,8 @@ switch ($mode)
'S_USER_NOTES' => ($user_notes_enabled) ? true : false,
'S_WARN_USER' => ($warn_user_enabled) ? true : false,
'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
'U_ADD_FRIEND' => (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode(htmlspecialchars_decode($member['username'], ENT_COMPAT))) : '',
'U_ADD_FOE' => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username'], ENT_COMPAT))) : '',
'U_ADD_FRIEND' => (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode(html_entity_decode($member['username'], ENT_COMPAT))) : '',
'U_ADD_FOE' => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(html_entity_decode($member['username'], ENT_COMPAT))) : '',
'U_REMOVE_FRIEND' => ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
'U_REMOVE_FOE' => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;mode=foes&amp;usernames[]=' . $user_id) : '',
@ -987,7 +987,7 @@ switch ($mode)
{
$user_list[] = [
'user_id' => (int) $row['user_id'],
'result' => htmlspecialchars_decode($row['username']),
'result' => html_entity_decode($row['username']),
'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'display' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']),
];

View File

@ -73,7 +73,7 @@ class apache extends base
*/
public function init()
{
if (!$this->request->is_set('PHP_AUTH_USER', request_interface::SERVER) || $this->user->data['username'] !== htmlspecialchars_decode($this->request->server('PHP_AUTH_USER'), ENT_COMPAT))
if (!$this->request->is_set('PHP_AUTH_USER', request_interface::SERVER) || $this->user->data['username'] !== html_entity_decode($this->request->server('PHP_AUTH_USER'), ENT_COMPAT))
{
return $this->language->lang('APACHE_SETUP_BEFORE_USE');
}
@ -113,8 +113,8 @@ class apache extends base
);
}
$php_auth_user = htmlspecialchars_decode($this->request->server('PHP_AUTH_USER'), ENT_COMPAT);
$php_auth_pw = htmlspecialchars_decode($this->request->server('PHP_AUTH_PW'), ENT_COMPAT);
$php_auth_user = html_entity_decode($this->request->server('PHP_AUTH_USER'), ENT_COMPAT);
$php_auth_pw = html_entity_decode($this->request->server('PHP_AUTH_PW'), ENT_COMPAT);
if (!empty($php_auth_user) && !empty($php_auth_pw))
{
@ -180,8 +180,8 @@ class apache extends base
return array();
}
$php_auth_user = htmlspecialchars_decode($this->request->server('PHP_AUTH_USER'), ENT_COMPAT);
$php_auth_pw = htmlspecialchars_decode($this->request->server('PHP_AUTH_PW'), ENT_COMPAT);
$php_auth_user = html_entity_decode($this->request->server('PHP_AUTH_USER'), ENT_COMPAT);
$php_auth_pw = html_entity_decode($this->request->server('PHP_AUTH_PW'), ENT_COMPAT);
if (!empty($php_auth_user) && !empty($php_auth_pw))
{

View File

@ -83,7 +83,7 @@ class ldap extends base
if ($this->config['ldap_user'] || $this->config['ldap_password'])
{
if (!@ldap_bind($ldap, htmlspecialchars_decode($this->config['ldap_user'], ENT_COMPAT), htmlspecialchars_decode($this->config['ldap_password'], ENT_COMPAT)))
if (!@ldap_bind($ldap, html_entity_decode($this->config['ldap_user'], ENT_COMPAT), html_entity_decode($this->config['ldap_password'], ENT_COMPAT)))
{
return $this->language->lang('LDAP_INCORRECT_USER_PASSWORD');
}
@ -92,11 +92,11 @@ class ldap extends base
// ldap_connect only checks whether the specified server is valid, so the connection might still fail
$search = @ldap_search(
$ldap,
htmlspecialchars_decode($this->config['ldap_base_dn'], ENT_COMPAT),
html_entity_decode($this->config['ldap_base_dn'], ENT_COMPAT),
$this->ldap_user_filter($this->user->data['username']),
(empty($this->config['ldap_email'])) ?
array(htmlspecialchars_decode($this->config['ldap_uid'], ENT_COMPAT)) :
array(htmlspecialchars_decode($this->config['ldap_uid'], ENT_COMPAT), htmlspecialchars_decode($this->config['ldap_email'], ENT_COMPAT)),
array(html_entity_decode($this->config['ldap_uid'], ENT_COMPAT)) :
array(html_entity_decode($this->config['ldap_uid'], ENT_COMPAT), html_entity_decode($this->config['ldap_email'], ENT_COMPAT)),
0,
1
);
@ -115,7 +115,7 @@ class ldap extends base
return $this->language->lang('LDAP_NO_IDENTITY', $this->user->data['username']);
}
if (!empty($this->config['ldap_email']) && !isset($result[0][htmlspecialchars_decode($this->config['ldap_email'])]))
if (!empty($this->config['ldap_email']) && !isset($result[0][html_entity_decode($this->config['ldap_email'])]))
{
return $this->language->lang('LDAP_NO_EMAIL');
}
@ -180,7 +180,7 @@ class ldap extends base
if ($this->config['ldap_user'] || $this->config['ldap_password'])
{
if (!@ldap_bind($ldap, htmlspecialchars_decode($this->config['ldap_user'], ENT_COMPAT), htmlspecialchars_decode($this->config['ldap_password'], ENT_COMPAT)))
if (!@ldap_bind($ldap, html_entity_decode($this->config['ldap_user'], ENT_COMPAT), html_entity_decode($this->config['ldap_password'], ENT_COMPAT)))
{
return array(
'status' => LOGIN_ERROR_EXTERNAL_AUTH,
@ -192,11 +192,11 @@ class ldap extends base
$search = @ldap_search(
$ldap,
htmlspecialchars_decode($this->config['ldap_base_dn'], ENT_COMPAT),
html_entity_decode($this->config['ldap_base_dn'], ENT_COMPAT),
$this->ldap_user_filter($username),
(empty($this->config['ldap_email'])) ?
array(htmlspecialchars_decode($this->config['ldap_uid'], ENT_COMPAT)) :
array(htmlspecialchars_decode($this->config['ldap_uid'], ENT_COMPAT), htmlspecialchars_decode($this->config['ldap_email'], ENT_COMPAT)),
array(html_entity_decode($this->config['ldap_uid'], ENT_COMPAT)) :
array(html_entity_decode($this->config['ldap_uid'], ENT_COMPAT), html_entity_decode($this->config['ldap_email'], ENT_COMPAT)),
0,
1
);
@ -205,7 +205,7 @@ class ldap extends base
if (is_array($ldap_result) && count($ldap_result) > 1)
{
if (@ldap_bind($ldap, $ldap_result[0]['dn'], htmlspecialchars_decode($password, ENT_COMPAT)))
if (@ldap_bind($ldap, $ldap_result[0]['dn'], html_entity_decode($password, ENT_COMPAT)))
{
@ldap_close($ldap);
@ -257,7 +257,7 @@ class ldap extends base
$ldap_user_row = array(
'username' => $username,
'user_password' => '',
'user_email' => (!empty($this->config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][htmlspecialchars_decode($this->config['ldap_email'], ENT_COMPAT)][0]) : '',
'user_email' => (!empty($this->config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][html_entity_decode($this->config['ldap_email'], ENT_COMPAT)][0]) : '',
'group_id' => (int) $row['group_id'],
'user_type' => USER_NORMAL,
'user_ip' => $this->user->ip,
@ -337,7 +337,7 @@ class ldap extends base
*/
private function ldap_user_filter($username)
{
$filter = '(' . $this->config['ldap_uid'] . '=' . $this->ldap_escape(htmlspecialchars_decode($username, ENT_COMPAT)) . ')';
$filter = '(' . $this->config['ldap_uid'] . '=' . $this->ldap_escape(html_entity_decode($username, ENT_COMPAT)) . ')';
if ($this->config['ldap_user_filter'])
{
$_filter = ($this->config['ldap_user_filter'][0] == '(' && substr($this->config['ldap_user_filter'], -1) == ')') ? $this->config['ldap_user_filter'] : "({$this->config['ldap_user_filter']})";

View File

@ -209,7 +209,7 @@ class activate extends command
$messenger->set_addresses($user_row);
$messenger->anti_abuse_headers($this->config, $this->user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username'], ENT_COMPAT))
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT))
);
$messenger->send(NOTIFY_EMAIL);

View File

@ -312,9 +312,9 @@ class add extends command
$messenger->to($this->data['email'], $this->data['username']);
$messenger->anti_abuse_headers($this->config, $this->user);
$messenger->assign_vars(array(
'WELCOME_MSG' => htmlspecialchars_decode($this->language->lang('WELCOME_SUBJECT', $this->config['sitename']), ENT_COMPAT),
'USERNAME' => htmlspecialchars_decode($this->data['username'], ENT_COMPAT),
'PASSWORD' => htmlspecialchars_decode($this->data['new_password'], ENT_COMPAT),
'WELCOME_MSG' => html_entity_decode($this->language->lang('WELCOME_SUBJECT', $this->config['sitename']), ENT_COMPAT),
'USERNAME' => html_entity_decode($this->data['username'], ENT_COMPAT),
'PASSWORD' => html_entity_decode($this->data['new_password'], ENT_COMPAT),
'U_ACTIVATE' => generate_board_url() . "/ucp.{$this->php_ext}?mode=activate&u=$user_id&k=$user_actkey")
);

View File

@ -418,7 +418,7 @@ class ajax_iohandler extends iohandler_base
if ($msg !== null)
{
$link_properties['msg'] = htmlspecialchars_decode($this->language->lang($msg), ENT_COMPAT);
$link_properties['msg'] = html_entity_decode($this->language->lang($msg), ENT_COMPAT);
}
$this->download[] = $link_properties;

View File

@ -108,7 +108,7 @@ abstract class iohandler_base implements iohandler_interface
{
if (!is_array($error_title) && strpos($error_title, '<br />') !== false)
{
$error_title = strip_tags(htmlspecialchars_decode($error_title, ENT_COMPAT));
$error_title = strip_tags(html_entity_decode($error_title, ENT_COMPAT));
}
$this->errors[] = $this->translate_message($error_title, $error_description);
}

View File

@ -120,8 +120,8 @@ class notify_user extends \phpbb\install\task_base
$messenger->to($this->config['board_email'], $this->install_config->get('admin_name'));
$messenger->anti_abuse_headers($this->config, $this->user);
$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($this->install_config->get('admin_name'), ENT_COMPAT),
'PASSWORD' => htmlspecialchars_decode($this->install_config->get('admin_passwd'), ENT_COMPAT))
'USERNAME' => html_entity_decode($this->install_config->get('admin_name'), ENT_COMPAT),
'PASSWORD' => html_entity_decode($this->install_config->get('admin_passwd'), ENT_COMPAT))
);
$messenger->send(NOTIFY_EMAIL);
}

View File

@ -54,7 +54,7 @@ class obtain_server_data extends \phpbb\install\task_base implements \phpbb\inst
$server_port = $this->io_handler->get_server_variable('SERVER_PORT', 0);
// HTTP_HOST is having the correct browser url in most cases...
$server_name = strtolower(htmlspecialchars_decode($this->io_handler->get_header_variable(
$server_name = strtolower(html_entity_decode($this->io_handler->get_header_variable(
'Host',
$this->io_handler->get_server_variable('SERVER_NAME')
), ENT_COMPAT));
@ -65,11 +65,11 @@ class obtain_server_data extends \phpbb\install\task_base implements \phpbb\inst
$server_name = substr($server_name, 0, strpos($server_name, ':'));
}
$script_path = htmlspecialchars_decode($this->io_handler->get_server_variable('PHP_SELF'), ENT_COMPAT);
$script_path = html_entity_decode($this->io_handler->get_server_variable('PHP_SELF'), ENT_COMPAT);
if (!$script_path)
{
$script_path = htmlspecialchars_decode($this->io_handler->get_server_variable('REQUEST_URI'), ENT_COMPAT);
$script_path = html_entity_decode($this->io_handler->get_server_variable('REQUEST_URI'), ENT_COMPAT);
}
$script_path = str_replace(array('\\', '//'), '/', $script_path);

View File

@ -87,7 +87,7 @@ class obtain_update_ftp_data extends task_base
$ftp_host = $this->iohandler->get_input('ftp_host', '', true);
$ftp_user = $this->iohandler->get_input('ftp_user', '', true);
$ftp_pass = htmlspecialchars_decode($this->iohandler->get_input('ftp_pass', '', true), ENT_COMPAT);
$ftp_pass = html_entity_decode($this->iohandler->get_input('ftp_pass', '', true), ENT_COMPAT);
$ftp_path = $this->iohandler->get_input('ftp_path', '', true);
$ftp_port = $this->iohandler->get_input('ftp_port', 21);
$ftp_time = $this->iohandler->get_input('ftp_timeout', 10);

View File

@ -262,13 +262,13 @@ class message
$messenger->headers('X-AntiAbuse: Username - ' . $this->sender_username);
}
$messenger->subject(htmlspecialchars_decode($this->subject, ENT_COMPAT));
$messenger->subject(html_entity_decode($this->subject, ENT_COMPAT));
$messenger->assign_vars(array(
'BOARD_CONTACT' => $contact,
'TO_USERNAME' => htmlspecialchars_decode($recipient['to_name'], ENT_COMPAT),
'FROM_USERNAME' => htmlspecialchars_decode($this->sender_name, ENT_COMPAT),
'MESSAGE' => htmlspecialchars_decode($this->body, ENT_COMPAT))
'TO_USERNAME' => html_entity_decode($recipient['to_name'], ENT_COMPAT),
'FROM_USERNAME' => html_entity_decode($this->sender_name, ENT_COMPAT),
'MESSAGE' => html_entity_decode($this->body, ENT_COMPAT))
);
if (count($this->template_vars))

View File

@ -122,7 +122,7 @@ class topic_form extends form
$this->message->set_template('email_notify');
$this->message->set_template_vars(array(
'TOPIC_NAME' => htmlspecialchars_decode($this->topic_row['topic_title'], ENT_COMPAT),
'TOPIC_NAME' => html_entity_decode($this->topic_row['topic_title'], ENT_COMPAT),
'U_TOPIC' => generate_board_url() . '/viewtopic.' . $this->phpEx . '?t=' . $this->topic_id,
));
$this->message->set_body($this->body);

View File

@ -150,7 +150,7 @@ class admin_activate_user extends \phpbb\notification\type\base
$username = $this->user_loader->get_username($this->item_id, 'username');
return array(
'USERNAME' => htmlspecialchars_decode($username, ENT_COMPAT),
'USERNAME' => html_entity_decode($username, ENT_COMPAT),
'U_USER_DETAILS' => "{$board_url}/memberlist.{$this->php_ext}?mode=viewprofile&u={$this->item_id}",
'U_ACTIVATE' => "{$board_url}/ucp.{$this->php_ext}?mode=activate&u={$this->item_id}&k={$this->get_data('user_actkey')}",
);

View File

@ -120,7 +120,7 @@ class disapprove_post extends \phpbb\notification\type\approve_post
public function get_email_template_variables()
{
return array_merge(parent::get_email_template_variables(), array(
'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason'), ENT_COMPAT),
'REASON' => html_entity_decode($this->get_data('disapprove_reason'), ENT_COMPAT),
));
}

View File

@ -120,7 +120,7 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic
public function get_email_template_variables()
{
return array_merge(parent::get_email_template_variables(), array(
'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason'), ENT_COMPAT),
'REASON' => html_entity_decode($this->get_data('disapprove_reason'), ENT_COMPAT),
));
}

View File

@ -130,10 +130,10 @@ class forum extends \phpbb\notification\type\post
}
return [
'AUTHOR_NAME' => htmlspecialchars_decode($username, ENT_COMPAT),
'FORUM_NAME' => htmlspecialchars_decode(censor_text($this->get_data('forum_name')), ENT_COMPAT),
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject')), ENT_COMPAT),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'AUTHOR_NAME' => html_entity_decode($username, ENT_COMPAT),
'FORUM_NAME' => html_entity_decode(censor_text($this->get_data('forum_name')), ENT_COMPAT),
'POST_SUBJECT' => html_entity_decode(censor_text($this->get_data('post_subject')), ENT_COMPAT),
'TOPIC_TITLE' => html_entity_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?t={$this->item_parent_id}&e=1&view=unread#unread",

View File

@ -133,8 +133,8 @@ class group_request extends \phpbb\notification\type\base
$user_data = $this->user_loader->get_user($this->item_id);
return array(
'GROUP_NAME' => htmlspecialchars_decode($this->get_data('group_name'), ENT_COMPAT),
'REQUEST_USERNAME' => htmlspecialchars_decode($user_data['username'], ENT_COMPAT),
'GROUP_NAME' => html_entity_decode($this->get_data('group_name'), ENT_COMPAT),
'REQUEST_USERNAME' => html_entity_decode($user_data['username'], ENT_COMPAT),
'U_PENDING' => generate_board_url() . "/ucp.{$this->php_ext}?i=groups&mode=manage&action=list&g={$this->item_parent_id}",
'U_GROUP' => generate_board_url() . "/memberlist.{$this->php_ext}?mode=group&g={$this->item_parent_id}",

View File

@ -164,8 +164,8 @@ class pm extends \phpbb\notification\type\base
$user_data = $this->user_loader->get_user($this->get_data('from_user_id'));
return array(
'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username'], ENT_COMPAT),
'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject')), ENT_COMPAT),
'AUTHOR_NAME' => html_entity_decode($user_data['username'], ENT_COMPAT),
'SUBJECT' => html_entity_decode(censor_text($this->get_data('message_subject')), ENT_COMPAT),
'U_VIEW_MESSAGE' => generate_board_url() . '/ucp.' . $this->php_ext . "?i=pm&mode=view&p={$this->item_id}",
);

View File

@ -262,9 +262,9 @@ class post extends \phpbb\notification\type\base
}
return array(
'AUTHOR_NAME' => htmlspecialchars_decode($username, ENT_COMPAT),
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject')), ENT_COMPAT),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'AUTHOR_NAME' => html_entity_decode($username, ENT_COMPAT),
'POST_SUBJECT' => html_entity_decode(censor_text($this->get_data('post_subject')), ENT_COMPAT),
'TOPIC_TITLE' => html_entity_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?t={$this->item_parent_id}&e=1&view=unread#unread",

View File

@ -168,7 +168,7 @@ class quote extends \phpbb\notification\type\post
$user_data = $this->user_loader->get_user($this->get_data('poster_id'));
return array_merge(parent::get_email_template_variables(), array(
'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username'], ENT_COMPAT),
'AUTHOR_NAME' => html_entity_decode($user_data['username'], ENT_COMPAT),
));
}

View File

@ -143,11 +143,11 @@ class report_pm extends \phpbb\notification\type\pm
$user_data = $this->user_loader->get_user($this->get_data('from_user_id'));
return [
'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username'], ENT_COMPAT),
'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject')), ENT_COMPAT),
'AUTHOR_NAME' => html_entity_decode($user_data['username'], ENT_COMPAT),
'SUBJECT' => html_entity_decode(censor_text($this->get_data('message_subject')), ENT_COMPAT),
/** @deprecated 3.2.6-RC1 (to be removed in 4.0.0) use {SUBJECT} instead in report_pm.txt */
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('message_subject')), ENT_COMPAT),
'TOPIC_TITLE' => html_entity_decode(censor_text($this->get_data('message_subject')), ENT_COMPAT),
'U_VIEW_REPORT' => generate_board_url() . "/mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details",
];

View File

@ -104,9 +104,9 @@ class report_pm_closed extends \phpbb\notification\type\pm
$closer_username = $this->user_loader->get_username($this->get_data('closer_id'), 'username');
return [
'AUTHOR_NAME' => htmlspecialchars_decode($sender_username, ENT_COMPAT),
'CLOSER_NAME' => htmlspecialchars_decode($closer_username, ENT_COMPAT),
'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject')), ENT_COMPAT),
'AUTHOR_NAME' => html_entity_decode($sender_username, ENT_COMPAT),
'CLOSER_NAME' => html_entity_decode($closer_username, ENT_COMPAT),
'SUBJECT' => html_entity_decode(censor_text($this->get_data('message_subject')), ENT_COMPAT),
'U_VIEW_MESSAGE'=> generate_board_url() . "/ucp.{$this->php_ext}?i=pm&amp;mode=view&amp;p={$this->item_id}",
];

View File

@ -110,8 +110,8 @@ class report_post extends \phpbb\notification\type\post_in_queue
$board_url = generate_board_url();
return array(
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject')), ENT_COMPAT),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'POST_SUBJECT' => html_entity_decode(censor_text($this->get_data('post_subject')), ENT_COMPAT),
'TOPIC_TITLE' => html_entity_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'U_VIEW_REPORT' => "{$board_url}/mcp.{$this->php_ext}?p={$this->item_id}&i=reports&mode=report_details#reports",
'U_VIEW_POST' => "{$board_url}/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",

View File

@ -111,10 +111,10 @@ class report_post_closed extends \phpbb\notification\type\post
$closer_username = $this->user_loader->get_username($this->get_data('closer_id'), 'username');
return [
'AUTHOR_NAME' => htmlspecialchars_decode($post_username, ENT_COMPAT),
'CLOSER_NAME' => htmlspecialchars_decode($closer_username, ENT_COMPAT),
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject')), ENT_COMPAT),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'AUTHOR_NAME' => html_entity_decode($post_username, ENT_COMPAT),
'CLOSER_NAME' => html_entity_decode($closer_username, ENT_COMPAT),
'POST_SUBJECT' => html_entity_decode(censor_text($this->get_data('post_subject')), ENT_COMPAT),
'TOPIC_TITLE' => html_entity_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
];

View File

@ -217,9 +217,9 @@ class topic extends \phpbb\notification\type\base
}
return array(
'AUTHOR_NAME' => htmlspecialchars_decode($username, ENT_COMPAT),
'FORUM_NAME' => htmlspecialchars_decode($this->get_data('forum_name'), ENT_COMPAT),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'AUTHOR_NAME' => html_entity_decode($username, ENT_COMPAT),
'FORUM_NAME' => html_entity_decode($this->get_data('forum_name'), ENT_COMPAT),
'TOPIC_TITLE' => html_entity_decode(censor_text($this->get_data('topic_title')), ENT_COMPAT),
'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?t={$this->item_id}",
'U_VIEW_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?t={$this->item_id}",

View File

@ -163,7 +163,7 @@ class plupload
'S_PLUPLOAD' => true,
'FILTERS' => $filters,
'CHUNK_SIZE' => $chunk_size,
'S_PLUPLOAD_URL' => htmlspecialchars_decode($s_action, ENT_COMPAT),
'S_PLUPLOAD_URL' => html_entity_decode($s_action, ENT_COMPAT),
'MAX_ATTACHMENTS' => $max_files,
'ATTACH_ORDER' => ($this->config['display_order']) ? 'asc' : 'desc',
'L_TOO_MANY_ATTACHMENTS' => $this->user->lang('TOO_MANY_ATTACHMENTS', $max_files),

View File

@ -232,7 +232,7 @@ class fulltext_mysql extends \phpbb\search\base
}
// Filter out as above
$split_keywords = preg_replace("#[\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords, ENT_COMPAT)));
$split_keywords = preg_replace("#[\n\r\t]+#", ' ', trim(html_entity_decode($keywords, ENT_COMPAT)));
// Split words
$split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
@ -597,7 +597,7 @@ class fulltext_mysql extends \phpbb\search\base
$sql = "SELECT $sql_select
FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p
WHERE MATCH ($sql_match) AGAINST ('" . $this->db->sql_escape(htmlspecialchars_decode($this->search_query, ENT_COMPAT)) . "' IN BOOLEAN MODE)
WHERE MATCH ($sql_match) AGAINST ('" . $this->db->sql_escape(html_entity_decode($this->search_query, ENT_COMPAT)) . "' IN BOOLEAN MODE)
$sql_where_options
ORDER BY $sql_sort";
$this->db->sql_return_on_error(true);

View File

@ -1824,7 +1824,7 @@ class fulltext_native extends \phpbb\search\base
/**
* Replace HTML entities and NCRs
*/
$text = htmlspecialchars_decode(utf8_decode_ncr($text), ENT_QUOTES);
$text = html_entity_decode(utf8_decode_ncr($text), ENT_QUOTES);
/**
* Normalize to NFC

View File

@ -204,7 +204,7 @@ class fulltext_postgres extends \phpbb\search\base
}
// Filter out as above
$split_keywords = preg_replace("#[\"\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords, ENT_COMPAT)));
$split_keywords = preg_replace("#[\"\n\r\t]+#", ' ', trim(html_entity_decode($keywords, ENT_COMPAT)));
// Split words
$split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));

View File

@ -49,7 +49,7 @@ class session
// If we are unable to get the script name we use REQUEST_URI as a failover and note it within the page array for easier support...
if (!$script_name)
{
$script_name = htmlspecialchars_decode($request->server('REQUEST_URI'), ENT_COMPAT);
$script_name = html_entity_decode($request->server('REQUEST_URI'), ENT_COMPAT);
$script_name = (($pos = strpos($script_name, '?')) !== false) ? substr($script_name, 0, $pos) : $script_name;
$page_array['failover'] = 1;
}
@ -166,7 +166,7 @@ class session
global $config, $request;
// Get hostname
$host = htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')), ENT_COMPAT);
$host = html_entity_decode($request->header('Host', $request->server('SERVER_NAME')), ENT_COMPAT);
// Should be a string and lowered
$host = (string) strtolower($host);
@ -289,7 +289,7 @@ class session
// Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
// it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.
$ip = htmlspecialchars_decode($request->server('REMOTE_ADDR'), ENT_COMPAT);
$ip = html_entity_decode($request->server('REMOTE_ADDR'), ENT_COMPAT);
$ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $ip));
/**

View File

@ -227,7 +227,7 @@ class data_access
{
foreach ($columns as $column)
{
$row[$column] = htmlspecialchars_decode($row[$column], ENT_COMPAT);
$row[$column] = html_entity_decode($row[$column], ENT_COMPAT);
}
}

View File

@ -265,7 +265,7 @@ class reset_password
$messenger->anti_abuse_headers($this->config, $this->user);
$messenger->assign_vars([
'USERNAME' => htmlspecialchars_decode($user_row['username'], ENT_COMPAT),
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),
'U_RESET_PASSWORD' => generate_board_url(true) . $this->helper->route('phpbb_ucp_reset_password_controller', [
'u' => $user_row['user_id'],
'token' => $reset_token,

View File

@ -678,16 +678,16 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '&quot;'), ' ', $keywords));
$hilit = str_replace(' ', '|', $hilit);
$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit), ENT_COMPAT));
$u_hilit = urlencode(html_entity_decode(str_replace('|', ' ', $hilit), ENT_COMPAT));
$u_show_results = '&amp;sr=' . $show_results;
$u_search_forum = implode('&amp;fid%5B%5D=', $search_forum);
$u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);
$u_search .= ($search_id) ? '&amp;search_id=' . $search_id : '';
$u_search .= ($u_hilit) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords, ENT_COMPAT)) : '';
$u_search .= ($u_hilit) ? '&amp;keywords=' . urlencode(html_entity_decode($keywords, ENT_COMPAT)) : '';
$u_search .= ($search_terms != 'all') ? '&amp;terms=' . $search_terms : '';
$u_search .= ($topic_id) ? '&amp;t=' . $topic_id : '';
$u_search .= ($author) ? '&amp;author=' . urlencode(htmlspecialchars_decode($author, ENT_COMPAT)) : '';
$u_search .= ($author) ? '&amp;author=' . urlencode(html_entity_decode($author, ENT_COMPAT)) : '';
$u_search .= ($author_id) ? '&amp;author_id=' . $author_id : '';
$u_search .= ($u_search_forum) ? '&amp;fid%5B%5D=' . $u_search_forum : '';
$u_search .= (!$search_child) ? '&amp;sc=0' : '';
@ -1564,7 +1564,7 @@ if ($auth->acl_get('a_search'))
'KEYWORDS' => $keywords,
'TIME' => $user->format_date($row['search_time']),
'U_KEYWORDS' => append_sid("{$phpbb_root_path}search.$phpEx", 'keywords=' . urlencode(htmlspecialchars_decode($keywords, ENT_COMPAT)))
'U_KEYWORDS' => append_sid("{$phpbb_root_path}search.$phpEx", 'keywords=' . urlencode(html_entity_decode($keywords, ENT_COMPAT)))
));
}
$db->sql_freeresult($result);

View File

@ -123,8 +123,8 @@ class phpbb_email_parsing_test extends phpbb_test_case
$this->messenger->set_addresses($user->data);
$this->messenger->assign_vars(array(
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'], ENT_COMPAT)),
'SITENAME' => htmlspecialchars_decode($config['sitename'], ENT_COMPAT),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . html_entity_decode($config['board_email_sig'], ENT_COMPAT)),
'SITENAME' => html_entity_decode($config['sitename'], ENT_COMPAT),
'AUTHOR_NAME' => $author_name,
'FORUM_NAME' => $forum_name,
@ -143,8 +143,8 @@ class phpbb_email_parsing_test extends phpbb_test_case
$this->assertStringContainsString($forum_name, $msg);
$this->assertStringContainsString($topic_title, $msg);
$this->assertStringContainsString($username, $msg);
$this->assertStringContainsString(htmlspecialchars_decode($config['sitename'], ENT_COMPAT), $msg);
$this->assertStringContainsString(str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'], ENT_COMPAT)), $msg);
$this->assertStringContainsString(html_entity_decode($config['sitename'], ENT_COMPAT), $msg);
$this->assertStringContainsString(str_replace('<br />', "\n", "-- \n" . html_entity_decode($config['board_email_sig'], ENT_COMPAT)), $msg);
$this->assertStringNotContainsString('EMAIL_SIG', $msg);
$this->assertStringNotContainsString('U_STOP_WATCHING_FORUM', $msg);
}