I found out that Drupal destroys links which contain nuber signs and thus makes it impossible to use links to a certain place on a page.
I have fixed this by replacing the following passage (line 2460) in drupal.inc.

return str_replace(array('%2F', '%26', '%23', '//'),
                       array('/', '%2526', '%2523', '/%252F'),
                       rawurlencode($text));

with

return str_replace(array('%2F', '%26', '%23', '//'),
array('/', '%2526', '%2523', '/%252F'),
str_replace("%23", "#", rawurlencode($text)));

Please review this patch and include it in the next Drupal version.

Comments

robertdouglass’s picture

Please include instructions on how to recreate the bug.

wmnnd’s picture

The bug occured together with taxonomy_redirect and when I entered a link with a "#" in a block.

robertdouglass’s picture

Title: Drupal destrying anchor links ("#") » Drupal destroying anchor links ("#")
Status: Needs review » Needs work

You will have a hard time getting a review of this patch without rolling a real patch, I'm afraid.

wmnnd’s picture

mhm ... no one to comment on this?

andreiashu’s picture

WishMasterNND I think robert is right: you won't have many reviewers because of the lack of a real patch and the lack of a real no-module-required replication method of this bug.

Have you considered that maybe the problem comes from taxonomy_redirect ?

dave reid’s picture

Status: Needs work » Postponed (maintainer needs more info)

We need actual 'steps' to reproduce the problem so we can determine if it is a core bug or a taxonomy_redirect bug.

wmnnd’s picture

What steps would you need?
You might just try it with taxonomy_redirect - I'm not so into Drupal's code that I could really know what's wrong here, but doing the change I posted above actually resolves the problem.

wmnnd’s picture

Status: Postponed (maintainer needs more info) » Needs review

It's still there in the current Drupal version ... what else info do you need?

wmnnd’s picture

It's now in "common.inc", btw.

dave reid’s picture

Version: 6.9 » 6.x-dev
Status: Needs review » Postponed (maintainer needs more info)

There is no patch to review. I have a feeling taxonomy_redirect should be smarter and 'split' the input provided up so that it can properly use parameters with url(). In this case, it should be passing a 'fragment' value in the $options parameter.

dpearcefl’s picture

Is this still an active issue?

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No response from OP, closing.