Closed (outdated)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Jan 2007 at 16:25 UTC
Updated:
2 Sep 2025 at 18:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
moonray commentedComment #2
Steven commentedWhich characters are allowed to be unescaped in a URL depends on the location in the URL. If we add such pretty printing, it needs to default to off, or otherwise drupal_urlencode() becomes useless in some situations. I think the best solution is a list of characters not to encode, passed as an array.
http://gbiv.com/protocols/uri/rfc/rfc3986.html#reserved
Comment #3
drummNo longer applies.
Needs to be patched in 6.x first.
Comment #4
ludo.rThis is an old issue, but it is still unpatched.
Please see this thread for more information : http://drupal.org/node/781192
I've tested a little patch (almost the same as #1), it corrects commas "," and pluses "+".
Comment #5
damien tournoud commentedThis is a feature request. Only 8.x is currently opened to those.
Comment #6
ludo.rOk, i didnt know that.
Thanks.
Comment #7
wojtha commentedRunning today in the same issue in D6.
URLs like
taxonomy/term/123%456C2%2C789instead oftaxonomy/term/123,456,789are really ugly.Comment #8
wojtha commentedFixing the title - drupal_urlencode was replaced by drupal_encode_path in D7+.
Is this really so big feature so it can't be backported?
I was thinking about fixing this in D7 using contrib module. Unfortunetally hook_drupal_goto_alter is called before the url() and drupal_encode_path().
Comment #10
wojtha commentedCorrecting test.
Comment #11
wojtha commentedComment #13
wojtha commentedHmm I see, allowing filenames to have commas and pluses is not nice...
I tried alternative approach, with the following patch additional "ignored" characters are passed as optional parameter of the drupal_encode_path(). +1 to this approach is also the reason that other ignored characters will be used only occassionally.
Comment #14
anouHello,
I like your approach, but I'd like to know where and/or when do you define $no_encode_chars ?
In a page_preprocess function ? In a module ?
My task was trying to let "?" and "=" not encoded when using hook_menu_breadcrumb_alter() in a custom module.
No success for the moment without modifying drupal_encode_path() directly in common.inc.
Comment #15
wojtha commented@anou with my patch you can set $options['no_encode_chars'] array at url() or at l() function.
Comment #16
thedavidmeister commented#13: 113035-13_drupal_encode_path_optional_unencode.patch queued for re-testing.
Comment #18
ñull commentedThe issue is here presented as "ugly" but nobody addressed the usability aspect. The resulting encoded URL is made public in the browser address field (the browser does not decode them). The ugly but valid URL can then be copied and pasted for instance in a Drupal menu path ( direct link to a often used tag query).
Now guess what happens when you do that. The encoded URL with pluses or commas is not recognised as valid URL! For an average user difficult to understand why it would not be valid and then forget about explaining how to decode the URL to make it work again. Something is really wrong here from a usability perspective. If you apparently oblige coded URLs with drupal_goto then they should be accepted everywhere!
Comment #19
ñull commentedComment #20
gavsiu commented[deleted]
(no button for actual delete)
Comment #21
mgiffordDoes drupal_encode_path() exist on D8 any more?
EDIT: Replaced with function encodePath($path)
Comment #35
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #36
smustgrave commentedSince drupal_encode_path has since been deprecated and removed. And this was request vs task going to close out. But if still needed please re-open.
Thanks all