Ticket #18 (new defect)

Opened 2 years ago

sfRouting: URL decoding problems

Reported by: adrian.rotea@gmail.com Assigned to: somebody
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc:

Description

Assuming the route and url below:

search-results:
  url:   /search/results/:query/:page
  param: { module: listing, action: search, page: 1 }

http://www.example.com/search/results/%2Btitle%3Ah%C3%B6rbuch+radio/1

where

%2Btitle%3Ah%C3%B6rbuch+radio

is the urlencoded query string

+title:hörbuch radio

then this query string is translated wrongly, probably because some extracalls of the urldecode function.

The resulted parameter will have the '+' replaced by an empty space.

The only way to have this parsed correctly is to urlencode or rawurlencode the query parameter before passing it to the url generation methods, i.e.:

$this->redirect('@search-results?query=' . rawurlencode($query));

but I don't want to do this double encoding. because the resulting url will look too bad (for search engines eventually), i.e:

http://www.example.com/search/results/%252Btitle%253Ah%25C3%25B6rbuch%2520radio/1

Could you consider a solution for this? Probably some checks to veryfy if an url is already decoded?

Regards