Use sprintf in "Untrusted Host" and "Invalid Host" exception

This commit is contained in:
Andrej Hudec 2013-08-28 23:44:20 +02:00
parent 5994f69a97
commit 713f62326b
1 changed files with 2 additions and 2 deletions

View File

@ -1112,7 +1112,7 @@ class Request
// as the host can come from the user (HTTP_HOST and depending on the configuration, SERVER_NAME too can come from the user)
// check that it does not contain forbidden characters (see RFC 952 and RFC 2181)
if ($host && !preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host)) {
throw new \UnexpectedValueException('Invalid Host "'.$host.'"');
throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host));
}
if (count(self::$trustedHostPatterns) > 0) {
@ -1130,7 +1130,7 @@ class Request
}
}
throw new \UnexpectedValueException('Untrusted Host "'.$host.'"');
throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host));
}
return $host;