Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
path.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2006 at 08:43 UTC
Updated:
25 Apr 2012 at 01:56 UTC
Jump to comment: Most recent file
Comments
Comment #1
phuc77 commentedThis problem still exists in 4.7.4.
The problem lies within path_set_alias, which calls on urldecode on the given path and translates '+' into ' ' as it's supposed to do.
But in our case when we submit an url, we use + as a plus.. not as a space :(
One quick hack could be to replace the + sign with it's decoded equivalent right before we decode the path
inside path_set_alias.
Other alternative is to submit taxonomy/term/651%2B652%2B653%2B654/0 instead of taxonomy/term/651+652+653+654/0.
Waiting for other suggestions...
Comment #2
dries commentedApparently, this problem exists in Drupal 5.0 RC2 ...
Comment #3
Steven commentedI'm not sure why the urldecode() is there... I assume it is so that you can copy/paste the path from a URL. But it's a very dangerous operation, as this problem shows.
rawurldecode() should be safer
Comment #4
Takafumi commentedIt works when urldecode() is replaced to rawurldecode().
However, I think that urldecode() is unnecessary.
Comment #5
drummComment #6
johnhanley commentedSurprisingly this problem still persists as of this writing.
Comment #7
catchThis is still a valid issue (and it's caught me out before), but the patch no longer applies.
Comment #8
drawk commentedRerolled for 7.x
Comment #9
drawk commentedComment #10
voxpelli commenteddrawk patch works for me - but it relies on #284899: Drupal url problem with clean urls - when that issue has been solved this patch can be applied.
Should this issue be postponed until then?
Comment #11
voxpelli commentedComment #13
postrational commentedThe patch submitted above works. If you remove line 90 from node.module, which reads:
$alias = urldecode($alias);then, you will be able to create aliases with the + sign in them. The problem is that these aliases don't work. After they are created, they show a "Page not found" error.
I wrote a cleaner way then just removing the line, use this function instead of urldecode:
Why do these aliases not work? Can someone point out where they fail, after they are already created?
Comment #14
voxpelli commented@postrational: I suggest looking at the issue I linked to in #10 - it's a problem with the clean url:s that needs to be fixed prior to this being fixable.
This should probably first be fixed in Drupal 7 and then be backported to Drupal 6 if possible.
Comment #15
sivaji_ganesh_jojodae commentedI wonder how drupal.org could use + in url (eg http://drupal.org/project/installation+profiles)
Comment #16
voxpelli commentedIt seems to work to use + in aliases in the latest D7 version. Can anyone else confirm?
Comment #17
dave reidI can save URL aliases with spaces in them, which work absolutely fine when used with '+' in URLs.
Comment #18
voxpelli commented@Dave Reid: That wasn't the problem - the problem was that if you actually wanted the character + in your alias then it wasn't encoded into %2B correctly and even when it was there was a problem in #284899: Drupal url problem with clean urls which prevented that alias to be resolved properly.
#284899: Drupal url problem with clean urls is now solved in D/. Can you confirm that creating aliases with real + has also been resolved and now works as expected so that + are encoded into %2B and that aliases containing such %2B characters can be used and resolved properly?
Changing status until anyone confirms this issue.
Comment #19
bleen commentedTested in D7 & D8 ... all is well with the world