Skip to content

Commit a474785

Browse files
atailouloutexabbuh
authored andcommitted
Update options_resolver.rst
The old code will not work as expected if the `host` option starts with `https`, the `substr` function will return `https:/` and not `https://`.
1 parent 78da6d5 commit a474785

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/options_resolver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ if you need to use other options during normalization::
464464
{
465465
// ...
466466
$resolver->setNormalizer('host', function (Options $options, $value) {
467-
if (!in_array(substr($value, 0, 7), array('http://', 'https://'))) {
467+
if ('http://' !== substr($value, 0, 7) && 'https://' !== substr($value, 0, 8)) {
468468
if ('ssl' === $options['encryption']) {
469469
$value = 'https://'.$value;
470470
} else {

0 commit comments

Comments
 (0)