From path containing query is not matched

jonathan_hunt - February 7, 2009 - 10:13
Project:Path redirect
Version:5.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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));

#1

Dave Reid - February 24, 2009 - 02:36
Status:active» postponed (maintainer needs more info)

Can you please try the latest 5.x-1.x-dev version and see if this is fixed for you?

#2

Dave Reid - October 27, 2009 - 04:46
Status:postponed (maintainer needs more info)» fixed

With no response, marking as fixed.

#3

System Message - November 10, 2009 - 04:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.