Patch parse_url.patch for URL related Bug #54369
Patch version 2011-03-24 14:47 UTC
Return to Bug #54369 |
Download this patch
Patch Revisions:
Developer: tomas.brastavicius@quantum.lt
Index: ext/standard/url.c
===================================================================
--- ext/standard/url.c (revision 309648)
+++ ext/standard/url.c (working copy)
@@ -208,26 +208,15 @@
e = ue;
- if (!(p = memchr(s, '/', (ue - s)))) {
- char *query, *fragment;
-
- query = memchr(s, '?', (ue - s));
- fragment = memchr(s, '#', (ue - s));
-
- if (query && fragment) {
- if (query > fragment) {
- p = e = fragment;
- } else {
- p = e = query;
- }
- } else if (query) {
- p = e = query;
- } else if (fragment) {
- p = e = fragment;
- }
- } else {
- e = p;
- }
+ if ((p = memchr(s, '/', (ue - s)))) {
+ e = p;
+ }
+ if ((p = memchr(s, '?', (ue - s))) && p < e) {
+ e = p;
+ }
+ if ((p = memchr(s, '#', (ue - s))) && p < e) {
+ e = p;
+ }
/* check for login and password */
if ((p = zend_memrchr(s, '@', (e-s)))) {
|