You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// HTTP_HOST can be modified by a visitor, but we already sanitized it
1020
-
// in backdrop_settings_initialize().
1019
+
// HTTP_HOST can be modified by a visitor, but we already sanitized it in
1020
+
// backdrop_environment_initialize().
1021
1021
if (!empty($_SERVER['HTTP_HOST'])) {
1022
1022
$cookie_domain = $_SERVER['HTTP_HOST'];
1023
1023
// Strip leading periods, www., and port numbers from cookie domain.
@@ -3123,9 +3123,13 @@ function _backdrop_bootstrap_configuration() {
3123
3123
install_goto('core/install.php');
3124
3124
}
3125
3125
3126
-
// Untrusted host names, throw an exception for the end-user.
3126
+
// Untrusted host names, return 400 Bad Request to the end-user.
3127
3127
if (!defined('MAINTENANCE_MODE') && !backdrop_check_trusted_hosts($_SERVER['HTTP_HOST'])) {
3128
-
thrownewException(format_string('The HTTP Host "@hostname" is not white-listed for this site. Check the trusted_host_patterns setting in settings.php.', array('@hostname' => $_SERVER['HTTP_HOST'])));
3128
+
http_response_code(400);
3129
+
printformat_string('HTTP Host "@hostname" is not included in the "trusted_host_patterns" setting of this site.', array(
3130
+
'@hostname' => $_SERVER['HTTP_HOST'],
3131
+
));
3132
+
exit;
3129
3133
}
3130
3134
3131
3135
// Bootstrap the database if it is needed but not yet available.
0 commit comments