Home » Networking » Net_URL2
Class for parsing and handling URL.
Download latest release 2.2.3 (there might be newer Composer installable version)
License: BSD-3-Clause
Description
Provides parsing of URLs into their constituent parts (scheme, host, path etc.), URL generation, and resolving of
relative URLs.
Maintainers
- Tom Klingenberg (tkli) — lead, active
- David Coallier (davidc) — lead, inactive
- Christian Schmidt (schmidt) — lead, inactive
Dependencies
Required
- PHP (>= 5.1.4)
- PEAR Installer (>= 1.4.0b1)
Releases
- 2.2.3 (stable, 2025-03-24)
Release notes
License: BSD-3-Clause
* Fix: Remove executable bit on *.php files
* Fix: libpcre2 10.45 compat: _encodeData \x shorthand for \x00 (Request #29032)
* Fix: PHP 8.4 compat: URL2: Make $array non optional in _queryArrayByBrackets (Bug #28649)
* Imp: Update CI to GitHub Actions
* Imp: Exclude dev files from Composer package - 2.2.2 (stable, 2025-03-11)
Release notes
License: BSD-3-Clause
* Fix: Set composer include path to keep other packages working
- 2.1.2 (stable, 2016-04-18)
- 2.2.1 (stable, 2016-04-18)
Release notes
License: BSD-3-Clause
* Fix: Correct earlier regex delimiter
* Fix: Travis missing hhvm-nightly
* Fix: Travis PHP 5.2
* Fix: Correct case of method call name - 2.2.0 (stable, 2015-04-18)
Release notes
License: BSD-3-Clause
* Changed composer autoloader to classmap, fixes include path pollution
- 2.1.1 (stable, 2014-12-27)
Release notes
License: BSD-3-Clause
* Fixed #20473: Normalize query and fragment broken
- 2.1.0 (stable, 2014-10-21)
Release notes
License: BSD-3-Clause
* New: OPTION_DROP_SEQUENCE
- 2.0.12 (stable, 2014-10-21)
Release notes
License: BSD-3-Clause
* Removed: OPTION_DROP_SEQUENCE
- 2.0.11 (stable, 2014-10-18)
Release notes
License: BSD-3-Clause
* New: OPTION_DROP_SEQUENCE
- 2.0.10 (stable, 2014-10-10)
Release notes
License: BSD-3-Clause
* Imp: composer for pear
* Fix: Documentation problem - 2.0.9 (stable, 2014-10-08)
Release notes
License: BSD-3-Clause
* Fixed #20418: Incorrect normalization of URI with missing authority
* Upd: Test for RFC 3986 Section 1.1.2 Examples
* Upd: Travis CI - PHP 5.6 added - 2.0.8 (stable, 2014-10-08)
Release notes
License: BSD-3-Clause
* Fixed #20420: Inconsistent setAuthority and getAuthority
* Fixed #20423: URI with IPv6 or IPvFuture not parsed
* Imp: Test for RFC 3986 Section 1.1.2 Examples - 2.0.7 (stable, 2014-09-07)
Release notes
License: BSD-3-Clause
* Fixed #20385: Incorrect normalization of userinfo
* Fixed #20399: Setting userinfo to FALSE not transparent - 2.0.6 (stable, 2014-06-21)
Release notes
License: BSD-3-Clause
* Fixed #20304: file:// URI gets crippled
- 2.0.5 (stable, 2014-01-01)
Release notes
License: BSD-3-Clause
* Fixed #17036: Brackets broken for query variables
* Fixed diverse coding style violations and misc. minor issues
* Increased code coverage - 2.0.4 (stable, 2013-12-31)
Release notes
License: BSD-3-Clause
* Fixed #20161: URLs with "0" as host fail to normalize with empty path
* A flaw in NetURL2::removeDotSegments() introduced in 2.0.1 has been fixed
* New: NetURL2::removeDotSegments() emits a warning on loop limit reach
* Url-segment maximum count raised from 100 to 256 (loop limit) - 2.0.3 (stable, 2013-12-30)
Release notes
License: BSD-3-Clause
* Fixed #20156: setAuthority() flaw with "0" as host
* Fixed #20157: normalize() flaw with "0" as path
* Fixed #20158: Fragment-only references are not resolved to non-absolute base URI
* Fixed #20159: Authority not terminated by slash
* Fixed diverse coding style violations and misc. minor issues
* Increased code coverage
* Added support for Scrutinizer CI - 2.0.2 (stable, 2013-12-27)
Release notes
License: BSD-3-Clause
* Fixed #19684: Redirects containing spaces do not work
* Fixed diverse coding style violations and misc. minor issues
* Improved source package distribution
* Added support for Travis CI - 2.0.1 (stable, 2013-12-25)
Release notes
License: BSD-3-Clause
* Fixed Bug #20013: getNormalizedURL() adds leading "@" chars in the Authority
* Fixed Bug #20016: Wrong data in 6d4f4dd "Package.xml preparation."
* Fixed Bug #19176: resolve() does not merge the path if the base path is empty
* Fixed Bug #19315: removeDotSegments("0") not working - 2.0.0 (stable, 2011-10-20)
Release notes
License: BSD-3-Clause
* Fixed the version of the release. Follow the convention for Package2.
* Fixed Bug #18917: URL2.php moved to ./Net/Net (davidc) - 1.0.0 (stable, 2011-10-20)
Release notes
License: BSD-3-Clause
* Fixed Bug #17036: Problem with parsed query string
* Fixed Bug #17087: setOption() function is gone
* Fixed #17166: Fluent Interface
* Fixed #17167: Refactor __construct
* Fixed Bug #18267: setQueryVariables() fails to encode array values
* Fixed Bug #14399: Fixed multiple bugs in Net_URL2 (Missing setOption value, unused properties, etc.) - 0.3.1 (beta, 2010-02-22)
Release notes
License: BSD-3-Clause
* BC break: Removed setOption() to avoid undefined behaviour (bug #16674)
* Fixed Bug #16854: Invalid package.xml making it impossible to install with Pyrus
* Fixed Bug #16651: Port may be an empty string
* Fixed Bug #16653: Don't make OPTION_SEPARATOR_(IN|OUT)PUT default to arg_separator.(in|out)put - 0.3.0 (beta, 2009-09-05)
Release notes
License: BSD-3-Clause
* Fixed #14399 (Errors in URL parsing (items #1 and #3))
* Fixed #14735 (Encode query string values)
* Fixed #15546 (Add adding __toString())
* Fixed #15367 (Use RFC 3986-compliant version of rawurlencode() in PHP < 5.2)
* Fixed #14289 (Add __get() and __set()) - 0.2.0 (beta, 2008-06-18)
Release notes
License: BSD-3-Clause
* Major rewrite to comply with RFC3986 (bug #11574).
* Much better support for resolving relative URLs.
* WARNING: Method and property names has changed to reflect the terminology used in the RFC - THIS RELEASE IS
NOT BACKWARDS COMPATIBLE WITH VERSION 0.1.0. - 0.1.0 (beta, 2007-05-07)
Release notes
License: BSD-3-Clause
Convert to PHP5 only. PHP4 users should continue with version 1.0.15
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #4542 | Closed | Req | 2005-06-07 | add a new api to manage anchor | |
| #6470 | Closed | Bug | 2006-01-11 | Path is not properly encoded | |
| #6531 | Closed | Req | 2006-01-19 | add "resolve path" option to getURL method | |
| #7538 | Wont fix | Req | 2006-05-01 | URLs without "http" confuse Net_URL | |
| #8633 | Closed | Req | 2006-09-04 | Add multple query strings | |
| #11574 | Closed | Bug | 0.1.0 | 2007-07-09 | Follow RFC 3986 closely |
| #13819 | Closed | Bug | 0.1.0 | 2008-05-02 | host is default 'localhost' |
| #14178 | Bogus | Bug | 0.1.0 | 2008-06-18 | resolvePath Problems |
| #14289 | Closed | Req | 0.2.0 | 2008-07-03 | Member variables should be protected not private |
| #14399 | Closed | Bug | 0.2.0 | 2008-07-24 | Multiple bugs in Net_URL2 |
| #14735 | Closed | Req | 0.2.0 | 2008-10-03 | Querystring values are not urlencoded |
| #14820 | Closed | Bug | CVS | 2008-10-18 | Call to undefined method Net_URL2::addQueryString() (unit tests) |
| #15367 | Closed | Req | 0.2.0 | 2008-12-20 | Support RFC 3986 with respect to urlencoding |
| #15546 | Closed | Req | 0.2.0 | 2009-01-07 | Implement __toString() instead of / as an alias for getUrl() |
| #16651 | Closed | Bug | 0.3.0 | 2009-09-28 | Allow empty port number |
| #16653 | Closed | Req | 0.3.0 | 2009-09-28 | Don't make OPTION_SEPARATOR_INPUT default to arg_separator.input |
| #16674 | Closed | Bug | 0.3.0 | 2009-10-03 | Options are ignored for already added query variables |
| #16854 | Bogus | Bug | 0.3.0 | 2009-11-30 | invalid package.xml |
| #17036 | Closed | Bug | 0.3.1 | 2010-01-26 | Problem with parsed query string |
| #17086 | Bogus | Bug | 0.3.1 | 2010-02-11 | URLs with urlencoding break Query Variables when runing unsetQueryVariable |
| #17087 | Closed | Bug | 0.3.1 | 2010-02-11 | setOption() function is gone |
| #17166 | Closed | Req | 0.3.1 | 2010-02-26 | Fluent interface |
| #17167 | Closed | Req | 0.3.1 | 2010-02-26 | Refactor __construct |
| #18267 | Closed | Bug | SVN | 2011-02-12 | setQueryVariables() fails to encode array values |
| #18917 | Closed | Bug | 1.0.0 | 2011-10-20 | URL2.php moved into ./Net/Net/ |
| #18921 | Closed | Bug | 2.0.0 | 2011-10-21 | package2.xml misses replace tasks |
| #19176 | Closed | Bug | 2.0.0 | 2011-12-31 | resolve() does not merge the path if the base path is empty |
| #19315 | Closed | Bug | SVN | 2012-03-04 | removeDotSegments("0") not working |
| #19684 | Closed | Req | 2.0.2 | 2012-10-30 | Redirects containing spaces do not work |
| #20013 | Closed | Bug | 2.0.0 | 2013-07-18 | getNormalizedURL() adds leading "@" chars in the Authority |
| #20016 | Closed | Bug | SVN | 2013-07-21 | Wrong data in 6d4f4dd "Package.xml preparation." |
| #20156 | Closed | Bug | 2.0.2 | 2013-12-27 | setAuthority() flaw with '0' as host |
| #20157 | Closed | Bug | 2.0.2 | 2013-12-27 | normalize() flaw with '0' as path |
| #20158 | Closed | Bug | 2.0.2 | 2013-12-28 | Fragment-only references are not resolved to non-absolute base URI |
| #20159 | Closed | Bug | 2.0.2 | 2013-12-28 | Authority not terminated by slash |
| #20161 | Closed | Bug | 2.0.3 | 2013-12-30 | URLs with "0" as host fail to normalize with empty path |
| #20304 | Closed | Bug | 2.0.5 | 2014-06-21 | Using Net_URL2 for a file:// URI cripples the URI. |
| #20385 | Closed | Bug | SVN | 2014-09-04 | Incorrect normalization of userinfo |
| #20399 | Closed | Bug | 2.0.6 | 2014-09-07 | Setting userinfo to FALSE not transparent |
| #20418 | Closed | Bug | 2.0.7 | 2014-10-02 | Incorrect normalization of URI with missing authority |
| #20420 | Closed | Bug | 2.0.7 | 2014-10-02 | Inconsistent setAuthority and getAuthority |
| #20421 | Wont fix | Bug | 2.0.7 | 2014-10-02 | Reject invalid path |
| #20423 | Closed | Bug | 2.0.7 | 2014-10-06 | URI with IPv6 or IPvFuture not parsed |
| #20425 | Open | Bug | 2.0.9 | 2014-10-09 | Incomplete percent-encoding of userinfo, path and query |
| #20427 | Closed | Req | 2.0.10 | 2014-10-15 | Option to not add numeric array keys in URL |
| #20433 | Closed | Doc | 2.1.0 | 2014-10-24 | Please, don't deliver outdated license file in sources |
| #20473 | Closed | Bug | 2.1.0 | 2014-12-27 | Normalize query and fragment borken |
| #20932 | Closed | Bug | SVN | 2015-08-03 | composer.json is missing include-path section |
| #21013 | Bogus | Bug | Unknown | 2016-01-03 | problem with two dots without trailing slash |
| #21104 | Bogus | Req | 2.1.2 | 2016-08-27 | support urls beginning with // |
| #21153 | Open | Bug | 2.1.2 | 2016-12-09 | When OPTION_ENCODE_KEYS is set to true, some brackets ([ and ]) arent' encoded |
| #28649 | Closed | Bug | SVN | 2024-08-30 | PHP 8.4 compatybility bug |
| #28662 | Closed | Req | 2.1.2 | 2024-11-25 | Minimum supported PHP version? |
| #29032 | Feedback | Req | 2025-03-07 | Release with PHP 8.4 support |