Skip to content

Revert "Fix parse_url(): can not recognize port without scheme" #9569

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
wants to merge 3 commits into from

Conversation

andypost
Copy link
Contributor

This reverts commit 72d8370.

Closes #9545

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't feel like addressing the actual root cause, and I think @cmb69 is already looking at fixing both?

@andypost
Copy link
Contributor Author

@Girgias according to #9545 (comment) it just needs revert

@Girgias Girgias requested a review from cmb69 September 19, 2022 15:21
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I don't see a way to support both scenarios (at least not without possibly breaking some other scenario). As such, we should revert, since #9545 is about a BC break, while #7844 has not been released as GA version.

We should have a test for what we broke in #9545, i.e. add the following cases to ext/standard/tests/strings/url_t.phpt:

'internal:#feeding', // used by drupal
'magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C', // used by drupal

@PandaLIU-1111, sorry for that.

Note to self: I shall not attempt to fix parse_url() – I shall not attempt to fix parse_url() – I shall not attempt to fix parse_url() – I shall not attempt to fix parse_url() – I shall not attempt to fix parse_url().

@@ -12,19 +12,19 @@ var_dump(parse_url('127.0.0.1:9999#'));
*** Testing parse_url() :can not recognize port without scheme ***
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the point in keeping this test. It has been introduced to show and verify that the other issue has been fixed; since we're going to revert, we should drop the test as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️ Since in the original change no other test was touched that's a pretty clear indication that this behavior is untested. Keeping this would make it more obvious if it ever changes again. But I'm fine either way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it shouldn't hurt to keep it, and it may help for future developement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ok to keep the comment as it documents current behavior

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@@ -12,19 +12,19 @@ var_dump(parse_url('127.0.0.1:9999#'));
*** Testing parse_url() :can not recognize port without scheme ***
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it shouldn't hurt to keep it, and it may help for future developement.

@iluuu1994 iluuu1994 closed this in 2108d69 Sep 23, 2022
@andypost andypost deleted the 9545-parse_url-regression branch September 23, 2022 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants