symfony/symfony — pull request #10683 by Remy-Luciani (2014-04-10 09:48:43+00:00)
Title: Fix URI replacement when ['HTTP_HOST'] starts with a number

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

----------------------------

I had an issue with the BrowserKit while doing functional testing with Behat. Actually, the URI generated had an IP address in place of the host. Because the host starts with a number, preg_replace tries to replace a backreference that selects nothing in the regexp pattern.

The previous bug is repeatable with the following code: