Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Invalid parsing/encoding of the URI userinfo #20

Open
cricog opened this issue Mar 1, 2018 · 1 comment
Open

Invalid parsing/encoding of the URI userinfo #20

cricog opened this issue Mar 1, 2018 · 1 comment

Comments

@cricog
Copy link

cricog commented Mar 1, 2018

Some characters are not properly parsed from string, and encoded when converted to string, in the userinfo. For example, the "@" char should be represented in strings as "%40" (but passed as "@" to the Authorization header for HTTP), and userinfo containing percent-encoded chars should be decoded/encoded the right way.

It seems that the following comment about "@" in https://github.com/zendframework/zend-uri/blob/master/src/Uri.php#L297 is wrong:

                // The userInfo can also contain '@' symbols; split $authority
                // into segments, and set it to the last segment.

form my understanding of the RFC-3986:

    userinfo    = *( unreserved / pct-encoded / sub-delims / ":" )
    unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
    pct-encoded = "%" HEXDIG HEXDIG
    sub-delims  = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-uri; a new issue has been opened at laminas/laminas-uri#2.

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

No branches or pull requests

2 participants