?? ??? 2006, Version 4.4.5
- Updated PCRE to version 6.7. (Ilia)
- Fixed bug #38963 (Fixed a possible open_basedir bypass in tempnam()). (Ilia)
+- Fixed bug #38859 (parse_url() fails if passing '@' in passwd). (Tony,Ilia)
- Fixed bug #38534 (segfault when calling setlocale() in userspace session
handler). (Tony)
- Fixed bug #38450 (constructor is not called for classes used in userspace
'http://foo.com#bar',
'scheme:',
'foo+bar://baz@bang/bla',
+'http://user:@pass@host/path?argument?value#etc',
);
foreach ($sample_urls as $url) {
["scheme"]=>
string(4) "http"
["host"]=>
- string(19) "hideout@www.php.net"
+ string(11) "www.php.net"
["port"]=>
int(80)
["user"]=>
- string(6) "secret"
+ string(14) "secret@hideout"
["path"]=>
string(10) "/index.php"
["query"]=>
["path"]=>
string(4) "/bla"
}
+array(7) {
+ ["scheme"]=>
+ string(4) "http"
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+ ["pass"]=>
+ string(5) "@pass"
+ ["path"]=>
+ string(5) "/path"
+ ["query"]=>
+ string(14) "argument?value"
+ ["fragment"]=>
+ string(3) "etc"
+}
\ No newline at end of file
} else {
e = p;
}
+
+ {
+ char *t = s;
+ p = NULL;
+ while (e > t && (t = memchr(t, '@', (e-t)))) {
+ p = t++;
+ }
+ }
/* check for login and password */
- if ((p = memchr(s, '@', (e-s)))) {
+ if (p) {
if ((pp = memchr(s, ':', (p-s)))) {
if ((pp-s) > 0) {
ret->user = estrndup(s, (pp-s));