php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54369
Patch bug54369_tests.patch revision 2011-03-24 15:30 UTC by tomas dot brastavicius at quantum dot lt
Patch parse_url.patch revision 2011-03-24 14:47 UTC by tomas dot brastavicius at quantum dot lt

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)))) {
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 18 08:03:35 2021 UTC