Closed (fixed)
Project:
Path redirect
Version:
5.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2009 at 10:13 UTC
Updated:
10 Nov 2009 at 04:50 UTC
From path entered as news/?year=2006
Saved in db as news%2F?year=2006 (partial urlencoding occurs in urlpath_redirect_edit_validate()).
When testing, entire incoming path is urlencoded (in path_redirect_init()):
WHERE path = 'news/?year=2006' OR path = 'news%2F%3Fyear%3D2006'
This doesn't match, and the redirect falls through to using 'news' instead.
My workaround is to use the same logic as urlpath_redirect_edit_validate() in path_redirect_init(), adding a third possible match for the db query:
$opt_path = urlencode(preg_replace('/\?.*/', '', $path)) . (strstr($path, '?') ? preg_replace('/.*(\?)/', '$1', $path) : '');
$r = db_fetch_object(db_query("SELECT rid, redirect, query, fragment, type FROM {path_redirect} WHERE path = '%s' OR path = '%s' or path = '%s'", $path, urlencode(utf8_encode($path)), $opt_path));
Comments
Comment #1
dave reidCan you please try the latest 5.x-1.x-dev version and see if this is fixed for you?
Comment #2
dave reidWith no response, marking as fixed.