Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Colon in url path is not parsed by parse_url #12703

Copy link
Copy link
Open
@vdauchy

Description

@vdauchy
Issue body actions

Description

parse_url() return false on absolute path containing : and no query string.

The following code:

<?php
var_dump(parse_url('/page:1?foo=bar'));  // Working example of parsing.

var_dump(parse_url('/page:1'));
var_dump(parse_url('/page:1', \PHP_URL_SCHEME));

Resulted in this output:

array(2) {
  ["path"]=>
  string(7) "/page:1"
  ["query"]=>
  string(7) "foo=bar"
}

bool(false)
bool(false)

But I expected this output instead:

array(2) {
  ["path"]=>
  string(7) "/page:1"
  ["query"]=>
  string(7) "foo=bar"
}

array(1) {
  ["path"]=>
  string(7) "/page:1"
}
NULL

This issue is opened following discussion on Symfony DomCrawler: symfony/symfony#52628

PHP Version

8.1.12

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.