Example #1
0
File: XRI.php Project: Blu2z/implsk
function Auth_Yadis_toIRINormal($xri)
{
    if (!Auth_Yadis_startswith($xri, 'xri://')) {
        $xri = 'xri://' . $xri;
    }
    return Auth_Yadis_escapeForIRI($xri);
}
Example #2
0
 function runTest()
 {
     // no escapes
     $this->assertEquals('@example/foo/(@bar)', Auth_Yadis_escapeForIRI('@example/foo/(@bar)'));
     // escape slashes
     $this->assertEquals('@example/foo/(@bar%2Fbaz)', Auth_Yadis_escapeForIRI('@example/foo/(@bar/baz)'));
     $this->assertEquals('@example/foo/(@bar%2Fbaz)/(+a%2Fb)', Auth_Yadis_escapeForIRI('@example/foo/(@bar/baz)/(+a/b)'));
     // escape query ? and fragment
     $this->assertEquals('@example/foo/(@baz%3Fp=q%23r)?i=j#k', Auth_Yadis_escapeForIRI('@example/foo/(@baz?p=q#r)?i=j#k'));
 }