8000 Greedy url fix in Component/BrowserKit/Client.php doesn't work with ip address · Issue #10641 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Greedy url fix in Component/BrowserKit/Client.php doesn't work with ip address #10641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rajeshtaneja opened this issue Apr 7, 2014 · 8 comments

Comments

@rajeshtaneja
Copy link

url greedy fix in 65b9810 caused regression for ip address.

http://127.0.0.1/foo => 27.0.0.1/foo

romainneutron added a commit to romainneutron/symfony that referenced this issue Apr 8, 2014
fabpot added a commit that referenced this issue Apr 9, 2014
…ip as host (romainneutron)

This PR was merged into the 2.3 branch.

Discussion
----------

[BrowserKit] Fix #10641 : BrowserKit is broken when using ip as host

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10641
| License       | MIT

As documented in http://php.net/manual/en/function.preg-replace.php, we have to use the `$` notation for replacing the backreference

>When working with a replacement pattern where a backreference is immediately followed by another number (i.e.: placing a literal number immediately after a matched pattern), you cannot use the familiar \\1 notation for your backreference. \\11, for example, would confuse preg_replace() since it does not know whether you want the \\1 backreference followed by a literal 1, or the \\11 backreference followed by nothing. In this case the solution is to use \${1}1. This creates an isolated $1 backreference, leaving the 1 as a literal.

Commits
-------

e946da3 [BrowserKit] Fix #10641 : BrowserKit is broken when using ip as host
@fabpot fabpot closed this as completed Apr 9, 2014
@rajeshtaneja
Copy link
Author

Thanks for fixing this Fabien and Romain

@rajeshtaneja
Copy link
Author

Can this be updated on 2.4 https://github.com/symfony/BrowserKit/commits/master, so composer can download this fix.

@stof
Copy link
Member
stof commented Apr 10, 2014

2.3 is merged into 2.4 (and then 2.4 into master) on a regular basis (generally once a week).

@rajeshtaneja
Copy link
Author

Thanks...

fabpot added a commit that referenced this issue Apr 10, 2014
* 2.3:
  Update MimeTypeExtensionGuesser.php
  [Templating] PhpEngine should propagate charset to its helpers
  Fix ticket #10663 - Added setCharset method call to PHP templating engine.
  Changed the typehint of the EsiFragmentRenderer to the interface
  [Form] Improved test coverage of UrlType
  [BrowserKit] Fix #10641 : BrowserKit is broken when using ip as host

Conflicts:
	src/Symfony/Component/HttpKernel/Fragment/EsiFragmentRenderer.php
	src/Symfony/Component/Templating/PhpEngine.php
fabpot added a commit that referenced this issue Apr 10, 2014
* 2.4:
  Update MimeTypeExtensionGuesser.php
  [Validator] Add missing polish translations
  [Validator] Added missing strings from Image validator
  [Templating] PhpEngine should propagate charset to its helpers
  Fix ticket #10663 - Added setCharset method call to PHP templating engine.
  Changed the typehint of the EsiFragmentRenderer to the interface
  [Form] Improved test coverage of UrlType
  [BrowserKit] Fix #10641 : BrowserKit is broken when using ip as host
@rajeshtaneja
Copy link
Author

Hello Fabien,

Would you mind fixing tag hash for v2.4.3, so this patch can be pulled by composer. Thanks.
https://github.com/symfony/BrowserKit/releases/tag/v2.4.3

@romainneutron
Copy link
Contributor

Hello @rajeshtaneja

version 2.4.3 has been released 10 days ago. The patch will therefore be available in version 2.4.4, approximatively in a month (tags are released at this period).

Meanwhile you can use branch 2.4 using this notation in your composer.json to get latest 2.4 branch:

{
    "require": {
        "symfony/symfony": "2.4.x-dev@dev"
    }
}

@stof
Copy link
Member
stof commented Apr 14, 2014

@rajeshtaneja a tah is never changed to a different commit. This is not how git is meant to work (you can force to recreate a tag on a different commit, but it creates lots of issues)

@rajeshtaneja
Copy link
Author

Thanks Fabien and Romain,

I was not aware of release process. I do understand tag hash should not be altered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0