@@ -1111,7 +1111,7 @@ abstract class driver implements driver_interface
- |
+ |
@@ -1132,7 +1132,7 @@ abstract class driver implements driver_interface
else
{
$error = $this->sql_error();
- $this->sql_report .= '
FAILED - ' . $this->sql_layer . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']);
+ $this->sql_report .= '
FAILED - ' . $this->sql_layer . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message'], ENT_COMPAT);
}
$this->sql_report .= '
';
@@ -1197,7 +1197,7 @@ abstract class driver implements driver_interface
$color = ($time_db > $time_cache) ? 'green' : 'red';
$this->sql_report .= '
Query results obtained from the cache |
---|
';
- $this->sql_report .= ' |
';
+ $this->sql_report .= '
| ';
$this->sql_report .= '
';
$this->sql_report .= 'Before: ' . sprintf('%.5f', $this->curtime - $starttime) . 's | After: ' . sprintf('%.5f', $endtime - $starttime) . 's | Elapsed [cache]: ' . sprintf('%.5f', ($time_cache)) . 's | Elapsed [db]: ' . sprintf('%.5f', $time_db) . 's
';
diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php
index 60b8db8310..706343495b 100644
--- a/phpBB/phpbb/extension/metadata_manager.php
+++ b/phpBB/phpbb/extension/metadata_manager.php
@@ -117,7 +117,7 @@ class metadata_manager
*/
public function sanitize_json(&$value, $key)
{
- $value = htmlspecialchars($value);
+ $value = htmlspecialchars($value, ENT_COMPAT);
}
/**
diff --git a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php
index 2a608f504e..f4fb364c55 100644
--- a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php
+++ b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php
@@ -418,7 +418,7 @@ class ajax_iohandler extends iohandler_base
if ($msg !== null)
{
- $link_properties['msg'] = htmlspecialchars_decode($this->language->lang($msg));
+ $link_properties['msg'] = htmlspecialchars_decode($this->language->lang($msg), ENT_COMPAT);
}
$this->download[] = $link_properties;
diff --git a/phpBB/phpbb/install/helper/iohandler/iohandler_base.php b/phpBB/phpbb/install/helper/iohandler/iohandler_base.php
index 1797a6c9ad..2a29fd3300 100644
--- a/phpBB/phpbb/install/helper/iohandler/iohandler_base.php
+++ b/phpBB/phpbb/install/helper/iohandler/iohandler_base.php
@@ -108,7 +108,7 @@ abstract class iohandler_base implements iohandler_interface
{
if (!is_array($error_title) && strpos($error_title, '
') !== false)
{
- $error_title = strip_tags(htmlspecialchars_decode($error_title));
+ $error_title = strip_tags(htmlspecialchars_decode($error_title, ENT_COMPAT));
}
$this->errors[] = $this->translate_message($error_title, $error_description);
}
diff --git a/phpBB/phpbb/install/module/install_data/task/add_languages.php b/phpBB/phpbb/install/module/install_data/task/add_languages.php
index 7ffdf4f276..cf661fb5d4 100644
--- a/phpBB/phpbb/install/module/install_data/task/add_languages.php
+++ b/phpBB/phpbb/install/module/install_data/task/add_languages.php
@@ -63,7 +63,7 @@ class add_languages extends \phpbb\install\task_base
$lang_pack = array(
'lang_iso' => $lang_info['iso'],
'lang_dir' => $lang_info['iso'],
- 'lang_english_name' => htmlspecialchars($lang_info['name']),
+ 'lang_english_name' => htmlspecialchars($lang_info['name'], ENT_COMPAT),
'lang_local_name' => htmlspecialchars($lang_info['local_name'], ENT_COMPAT, 'UTF-8'),
'lang_author' => htmlspecialchars($lang_info['author'], ENT_COMPAT, 'UTF-8'),
);
diff --git a/phpBB/phpbb/install/module/install_finish/task/notify_user.php b/phpBB/phpbb/install/module/install_finish/task/notify_user.php
index 57bff1e311..ea4fe92ec2 100644
--- a/phpBB/phpbb/install/module/install_finish/task/notify_user.php
+++ b/phpBB/phpbb/install/module/install_finish/task/notify_user.php
@@ -114,8 +114,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')),
- 'PASSWORD' => htmlspecialchars_decode($this->install_config->get('admin_passwd')))
+ 'USERNAME' => htmlspecialchars_decode($this->install_config->get('admin_name'), ENT_COMPAT),
+ 'PASSWORD' => htmlspecialchars_decode($this->install_config->get('admin_passwd'), ENT_COMPAT))
);
$messenger->send(NOTIFY_EMAIL);
}
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php
index 5096ce284e..6b5a14c117 100644
--- a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php
@@ -57,7 +57,7 @@ class obtain_server_data extends \phpbb\install\task_base implements \phpbb\inst
$server_name = strtolower(htmlspecialchars_decode($this->io_handler->get_header_variable(
'Host',
$this->io_handler->get_server_variable('SERVER_NAME')
- )));
+ ), ENT_COMPAT));
// HTTP HOST can carry a port number...
if (strpos($server_name, ':') !== false)
@@ -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'));
+ $script_path = htmlspecialchars_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'));
+ $script_path = htmlspecialchars_decode($this->io_handler->get_server_variable('REQUEST_URI'), ENT_COMPAT);
}
$script_path = str_replace(array('\\', '//'), '/', $script_path);
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_update_ftp_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_update_ftp_data.php
index d94cc4b5fd..0bf625d898 100644
--- a/phpBB/phpbb/install/module/obtain_data/task/obtain_update_ftp_data.php
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_update_ftp_data.php
@@ -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));
+ $ftp_pass = htmlspecialchars_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);
diff --git a/phpBB/phpbb/message/message.php b/phpBB/phpbb/message/message.php
index 6b742d6c00..e1475bd339 100644
--- a/phpBB/phpbb/message/message.php
+++ b/phpBB/phpbb/message/message.php
@@ -262,13 +262,13 @@ class message
$messenger->headers('X-AntiAbuse: Username - ' . $this->sender_username);
}
- $messenger->subject(htmlspecialchars_decode($this->subject));
+ $messenger->subject(htmlspecialchars_decode($this->subject, ENT_COMPAT));
$messenger->assign_vars(array(
'BOARD_CONTACT' => $contact,
- 'TO_USERNAME' => htmlspecialchars_decode($recipient['to_name']),
- 'FROM_USERNAME' => htmlspecialchars_decode($this->sender_name),
- 'MESSAGE' => htmlspecialchars_decode($this->body))
+ '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))
);
if (count($this->template_vars))
diff --git a/phpBB/phpbb/message/topic_form.php b/phpBB/phpbb/message/topic_form.php
index dbb883c142..cc1c4514d7 100644
--- a/phpBB/phpbb/message/topic_form.php
+++ b/phpBB/phpbb/message/topic_form.php
@@ -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']),
+ 'TOPIC_NAME' => htmlspecialchars_decode($this->topic_row['topic_title'], ENT_COMPAT),
'U_TOPIC' => generate_board_url() . '/viewtopic.' . $this->phpEx . '?f=' . $this->topic_row['forum_id'] . '&t=' . $this->topic_id,
));
$this->message->set_body($this->body);
diff --git a/phpBB/phpbb/notification/type/admin_activate_user.php b/phpBB/phpbb/notification/type/admin_activate_user.php
index 78c10ac36a..7b407ce92d 100644
--- a/phpBB/phpbb/notification/type/admin_activate_user.php
+++ b/phpBB/phpbb/notification/type/admin_activate_user.php
@@ -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),
+ 'USERNAME' => htmlspecialchars_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')}",
);
diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php
index 2d908eb254..2d2f7997b5 100644
--- a/phpBB/phpbb/notification/type/disapprove_post.php
+++ b/phpBB/phpbb/notification/type/disapprove_post.php
@@ -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')),
+ 'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason'), ENT_COMPAT),
));
}
diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php
index c2522fb562..01d611238b 100644
--- a/phpBB/phpbb/notification/type/disapprove_topic.php
+++ b/phpBB/phpbb/notification/type/disapprove_topic.php
@@ -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')),
+ 'REASON' => htmlspecialchars_decode($this->get_data('disapprove_reason'), ENT_COMPAT),
));
}
diff --git a/phpBB/phpbb/notification/type/forum.php b/phpBB/phpbb/notification/type/forum.php
index 161ec1e780..a490881e48 100644
--- a/phpBB/phpbb/notification/type/forum.php
+++ b/phpBB/phpbb/notification/type/forum.php
@@ -130,10 +130,10 @@ class forum extends \phpbb\notification\type\post
}
return [
- 'AUTHOR_NAME' => htmlspecialchars_decode($username),
- 'FORUM_NAME' => htmlspecialchars_decode(censor_text($this->get_data('forum_name'))),
- 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
+ '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),
'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}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&e=1&view=unread#unread",
diff --git a/phpBB/phpbb/notification/type/group_request.php b/phpBB/phpbb/notification/type/group_request.php
index 28a9e73bf9..ce5231f9d1 100644
--- a/phpBB/phpbb/notification/type/group_request.php
+++ b/phpBB/phpbb/notification/type/group_request.php
@@ -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')),
- 'REQUEST_USERNAME' => htmlspecialchars_decode($user_data['username']),
+ 'GROUP_NAME' => htmlspecialchars_decode($this->get_data('group_name'), ENT_COMPAT),
+ 'REQUEST_USERNAME' => htmlspecialchars_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}",
diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php
index c51586afb9..20b206e70b 100644
--- a/phpBB/phpbb/notification/type/pm.php
+++ b/phpBB/phpbb/notification/type/pm.php
@@ -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']),
- 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),
+ 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username'], ENT_COMPAT),
+ 'SUBJECT' => htmlspecialchars_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}",
);
diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php
index a25328ff43..a83a8a6d52 100644
--- a/phpBB/phpbb/notification/type/post.php
+++ b/phpBB/phpbb/notification/type/post.php
@@ -262,9 +262,9 @@ class post extends \phpbb\notification\type\base
}
return array(
- 'AUTHOR_NAME' => htmlspecialchars_decode($username),
- 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
+ '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),
'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}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&e=1&view=unread#unread",
diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php
index 323c18b204..826d40e6da 100644
--- a/phpBB/phpbb/notification/type/quote.php
+++ b/phpBB/phpbb/notification/type/quote.php
@@ -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']),
+ 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username'], ENT_COMPAT),
));
}
diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php
index 0b2054b259..0fd2654cb1 100644
--- a/phpBB/phpbb/notification/type/report_pm.php
+++ b/phpBB/phpbb/notification/type/report_pm.php
@@ -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']),
- 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),
+ 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username'], ENT_COMPAT),
+ 'SUBJECT' => htmlspecialchars_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'))),
+ 'TOPIC_TITLE' => htmlspecialchars_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",
];
diff --git a/phpBB/phpbb/notification/type/report_pm_closed.php b/phpBB/phpbb/notification/type/report_pm_closed.php
index 1901a3b2d5..2c3a7cb3b0 100644
--- a/phpBB/phpbb/notification/type/report_pm_closed.php
+++ b/phpBB/phpbb/notification/type/report_pm_closed.php
@@ -104,9 +104,9 @@ class report_pm_closed extends \phpbb\notification\type\pm
$closer_data = $this->user_loader->get_username($this->get_data('closer_id'), 'username');
return [
- 'AUTHOR_NAME' => htmlspecialchars_decode($sender_data['username']),
- 'CLOSER_NAME' => htmlspecialchars_decode($closer_data['username']),
- 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),
+ 'AUTHOR_NAME' => htmlspecialchars_decode($sender_data['username'], ENT_COMPAT),
+ 'CLOSER_NAME' => htmlspecialchars_decode($closer_data['username'], ENT_COMPAT),
+ 'SUBJECT' => htmlspecialchars_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}",
];
diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php
index e5e04bac6d..4548f29957 100644
--- a/phpBB/phpbb/notification/type/report_post.php
+++ b/phpBB/phpbb/notification/type/report_post.php
@@ -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'))),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
+ '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),
'U_VIEW_REPORT' => "{$board_url}/mcp.{$this->php_ext}?f={$this->get_data('forum_id')}&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}",
diff --git a/phpBB/phpbb/notification/type/report_post_closed.php b/phpBB/phpbb/notification/type/report_post_closed.php
index 9344aa1fb7..5358846344 100644
--- a/phpBB/phpbb/notification/type/report_post_closed.php
+++ b/phpBB/phpbb/notification/type/report_post_closed.php
@@ -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),
- 'CLOSER_NAME' => htmlspecialchars_decode($closer_username),
- 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
+ '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),
'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
];
diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php
index 2535cdaed6..f3aa93ffd8 100644
--- a/phpBB/phpbb/notification/type/topic.php
+++ b/phpBB/phpbb/notification/type/topic.php
@@ -217,9 +217,9 @@ class topic extends \phpbb\notification\type\base
}
return array(
- 'AUTHOR_NAME' => htmlspecialchars_decode($username),
- 'FORUM_NAME' => htmlspecialchars_decode($this->get_data('forum_name')),
- 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
+ '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),
'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
'U_VIEW_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php
index a94fbb7617..f0b36abb40 100644
--- a/phpBB/phpbb/plupload/plupload.php
+++ b/phpBB/phpbb/plupload/plupload.php
@@ -163,7 +163,7 @@ class plupload
'S_PLUPLOAD' => true,
'FILTERS' => $filters,
'CHUNK_SIZE' => $chunk_size,
- 'S_PLUPLOAD_URL' => htmlspecialchars_decode($s_action),
+ 'S_PLUPLOAD_URL' => htmlspecialchars_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),
diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php
index 581a20f506..b493ccf326 100644
--- a/phpBB/phpbb/search/fulltext_mysql.php
+++ b/phpBB/phpbb/search/fulltext_mysql.php
@@ -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)));
+ $split_keywords = preg_replace("#[\n\r\t]+#", ' ', trim(htmlspecialchars_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)) . "' IN BOOLEAN MODE)
+ WHERE MATCH ($sql_match) AGAINST ('" . $this->db->sql_escape(htmlspecialchars_decode($this->search_query, ENT_COMPAT)) . "' IN BOOLEAN MODE)
$sql_where_options
ORDER BY $sql_sort";
$this->db->sql_return_on_error(true);
diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php
index d38ee88a75..0b7b32a6c6 100644
--- a/phpBB/phpbb/search/fulltext_postgres.php
+++ b/phpBB/phpbb/search/fulltext_postgres.php
@@ -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)));
+ $split_keywords = preg_replace("#[\"\n\r\t]+#", ' ', trim(htmlspecialchars_decode($keywords, ENT_COMPAT)));
// Split words
$split_keywords = preg_replace('#([^\p{L}\p{N}\'*"()])#u', '$1$1', str_replace('\'\'', '\' \'', trim($split_keywords)));
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index df92cef983..8f24f970da 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -1045,7 +1045,7 @@ class fulltext_sphinx
' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '
- - ' . (($this->config_generate()) ? '' : $this->config_file_data) . '
+ - ' . (($this->config_generate()) ? '' : $this->config_file_data) . '
';
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index 743735a226..82f134eaf9 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -52,7 +52,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'));
+ $script_name = htmlspecialchars_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;
}
@@ -86,7 +86,7 @@ class session
// basenamed page name (for example: index.php)
$page_name = (substr($script_name, -1, 1) == '/') ? '' : basename($script_name);
- $page_name = urlencode(htmlspecialchars($page_name));
+ $page_name = urlencode(htmlspecialchars($page_name, ENT_COMPAT));
$symfony_request_path = filesystem_helper::clean_path($symfony_request->getPathInfo());
if ($symfony_request_path !== '/')
@@ -151,8 +151,8 @@ class session
'page_dir' => $page_dir,
'query_string' => $query_string,
- 'script_path' => str_replace(' ', '%20', htmlspecialchars($script_path)),
- 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)),
+ 'script_path' => str_replace(' ', '%20', htmlspecialchars($script_path, ENT_COMPAT)),
+ 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path, ENT_COMPAT)),
'page' => $page,
'forum' => $forum_id,
@@ -169,7 +169,7 @@ class session
global $config, $request;
// Get hostname
- $host = htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')));
+ $host = htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')), ENT_COMPAT);
// Should be a string and lowered
$host = (string) strtolower($host);
@@ -292,7 +292,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'));
+ $ip = htmlspecialchars_decode($request->server('REMOTE_ADDR'), ENT_COMPAT);
$ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $ip));
/**
@@ -458,8 +458,8 @@ class session
$s_ip,
$u_browser,
$s_browser,
- htmlspecialchars($u_forwarded_for),
- htmlspecialchars($s_forwarded_for)
+ htmlspecialchars($u_forwarded_for, ENT_COMPAT),
+ htmlspecialchars($s_forwarded_for, ENT_COMPAT)
));
}
else
@@ -1585,7 +1585,7 @@ class session
return true;
}
- $host = htmlspecialchars($this->host);
+ $host = htmlspecialchars($this->host, ENT_COMPAT);
$ref = substr($this->referer, strpos($this->referer, '://') + 3);
if (!(stripos($ref, $host) === 0) && (!$config['force_server_vars'] || !(stripos($ref, $config['server_name']) === 0)))
diff --git a/phpBB/phpbb/textformatter/data_access.php b/phpBB/phpbb/textformatter/data_access.php
index 0d37e62c87..27ce778904 100644
--- a/phpBB/phpbb/textformatter/data_access.php
+++ b/phpBB/phpbb/textformatter/data_access.php
@@ -227,7 +227,7 @@ class data_access
{
foreach ($columns as $column)
{
- $row[$column] = htmlspecialchars_decode($row[$column]);
+ $row[$column] = htmlspecialchars_decode($row[$column], ENT_COMPAT);
}
}
diff --git a/phpBB/phpbb/ucp/controller/reset_password.php b/phpBB/phpbb/ucp/controller/reset_password.php
index 6a6e9f5b47..30d2f1700f 100644
--- a/phpBB/phpbb/ucp/controller/reset_password.php
+++ b/phpBB/phpbb/ucp/controller/reset_password.php
@@ -118,7 +118,7 @@ class reset_password
if (!$this->config['allow_password_reset'])
{
throw new http_exception(Response::HTTP_OK, 'UCP_PASSWORD_RESET_DISABLED', [
- '',
+ '',
''
]);
}
@@ -265,7 +265,7 @@ class reset_password
$messenger->anti_abuse_headers($this->config, $this->user);
$messenger->assign_vars([
- 'USERNAME' => htmlspecialchars_decode($user_row['username']),
+ 'USERNAME' => htmlspecialchars_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,
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index b85f226497..fb3f666426 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -328,7 +328,7 @@ class user extends \phpbb\session
if (is_string($default_value))
{
- $this->style[$key] = htmlspecialchars($this->style[$key]);
+ $this->style[$key] = htmlspecialchars($this->style[$key], ENT_COMPAT);
}
}
diff --git a/phpBB/search.php b/phpBB/search.php
index c0f91abb91..048985b023 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -678,16 +678,16 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords));
$hilit = str_replace(' ', '|', $hilit);
- $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
+ $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit), ENT_COMPAT));
$u_show_results = '&sr=' . $show_results;
$u_search_forum = implode('&fid%5B%5D=', $search_forum);
$u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);
$u_search .= ($search_id) ? '&search_id=' . $search_id : '';
- $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
+ $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords, ENT_COMPAT)) : '';
$u_search .= ($search_terms != 'all') ? '&terms=' . $search_terms : '';
$u_search .= ($topic_id) ? '&t=' . $topic_id : '';
- $u_search .= ($author) ? '&author=' . urlencode(htmlspecialchars_decode($author)) : '';
+ $u_search .= ($author) ? '&author=' . urlencode(htmlspecialchars_decode($author, ENT_COMPAT)) : '';
$u_search .= ($author_id) ? '&author_id=' . $author_id : '';
$u_search .= ($u_search_forum) ? '&fid%5B%5D=' . $u_search_forum : '';
$u_search .= (!$search_child) ? '&sc=0' : '';
@@ -1569,7 +1569,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)))
+ 'U_KEYWORDS' => append_sid("{$phpbb_root_path}search.$phpEx", 'keywords=' . urlencode(htmlspecialchars_decode($keywords, ENT_COMPAT)))
));
}
$db->sql_freeresult($result);
diff --git a/tests/email/email_parsing_test.php b/tests/email/email_parsing_test.php
index 5c4844927e..f5ec3f6f1a 100644
--- a/tests/email/email_parsing_test.php
+++ b/tests/email/email_parsing_test.php
@@ -122,8 +122,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('
', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
- 'SITENAME' => htmlspecialchars_decode($config['sitename']),
+ 'EMAIL_SIG' => str_replace('
', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'], ENT_COMPAT)),
+ 'SITENAME' => htmlspecialchars_decode($config['sitename'], ENT_COMPAT),
'AUTHOR_NAME' => $author_name,
'FORUM_NAME' => $forum_name,
@@ -142,8 +142,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']), $msg);
- $this->assertStringContainsString(str_replace('
', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])), $msg);
+ $this->assertStringContainsString(htmlspecialchars_decode($config['sitename'], ENT_COMPAT), $msg);
+ $this->assertStringContainsString(str_replace('
', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'], ENT_COMPAT)), $msg);
$this->assertStringNotContainsString('EMAIL_SIG', $msg);
$this->assertStringNotContainsString('U_STOP_WATCHING_FORUM', $msg);
}
diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php
index c77a7ee401..9b01eb73fd 100644
--- a/tests/upload/filespec_test.php
+++ b/tests/upload/filespec_test.php
@@ -530,7 +530,7 @@ class phpbb_filespec_test extends phpbb_test_case
$type_cast_helper->set_var($upload_name, $filename, 'string', true, true);
$filespec = $this->get_filespec(array('name'=> $upload_name));
- $this->assertSame(trim(utf8_basename(htmlspecialchars($filename))), $filespec->get('uploadname'));
+ $this->assertSame(trim(utf8_basename(htmlspecialchars($filename, ENT_COMPAT))), $filespec->get('uploadname'));
}
public function test_is_uploaded()