Skip to content

Commit

Permalink
Merge branch 'PHP-5.4'
Browse files Browse the repository at this point in the history
* PHP-5.4:
  add bug #63162
  fix test and move to proper place
  synergy ftl. Removed duplicate fields.
  adding test phpt
  Bug #63162 - parse_url does not matches password component
  fix news
  • Loading branch information
smalyshev committed Oct 1, 2012
2 parents f8d1fc6 + 457844a commit 815248d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
38 changes: 38 additions & 0 deletions ext/standard/tests/url/bug63162.phpt
@@ -0,0 +1,38 @@
--TEST--
Test parse_url() for bug #63162
--DESCRIPTION--
This test covers tests the inputs:
[0]=> http://user:pass@host
[1]=> //user:pass@host
[2]=> //user@host
--FILE--
<?php
var_dump(parse_url('http://user:pass@host'));
var_dump(parse_url('//user:pass@host'));
var_dump(parse_url('//user@host'));
?>
--EXPECT--
array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
string(4) "host"
["user"]=>
string(4) "user"
["pass"]=>
string(4) "pass"
}
array(3) {
["host"]=>
string(4) "host"
["user"]=>
string(4) "user"
["pass"]=>
string(4) "pass"
}
array(2) {
["host"]=>
string(4) "host"
["user"]=>
string(4) "user"
}
2 changes: 2 additions & 0 deletions ext/standard/url.c
Expand Up @@ -201,6 +201,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
STR_FREE(ret->scheme);
efree(ret);
return NULL;
} else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */
s += 2;
} else {
goto just_path;
}
Expand Down

0 comments on commit 815248d

Please sign in to comment.