From a474785ddbdae737195e1e8271b49019c4f74b5d Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Tue, 31 May 2016 21:20:50 +0100 Subject: [PATCH] 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://`. --- components/options_resolver.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/options_resolver.rst b/components/options_resolver.rst index ce7ccf25fa9..a782af10795 100644 --- a/components/options_resolver.rst +++ b/components/options_resolver.rst @@ -464,7 +464,7 @@ if you need to use other options during normalization:: { // ... $resolver->setNormalizer('host', function (Options $options, $value) { - if (!in_array(substr($value, 0, 7), array('http://', 'https://'))) { + if ('http://' !== substr($value, 0, 7) && 'https://' !== substr($value, 0, 8)) { if ('ssl' === $options['encryption']) { $value = 'https://'.$value; } else {