Problem creating pages with symbols such as ampersand

chrism2671 - March 26, 2008 - 19:42
Project:Wikitools
Version:5.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Say I created a wikilink [[Alpha & Beta]] which would create a path wiki/Alpha_&_Beta (urlencoded).

When the nodes does not exist it offers to create a page entitled "Alpha" instead of "Alpha & Beta".

Furthermore, in cases where the node does exist, it does not necessarily retrieve the page, rather stating that 'Alpha' does not exist and asking if I would like to create it.

I have been able to correct the issue where the node exists but only by reprogramming the wikilink to search for the node title and change the path to the real path in drupal (using $node->path). Needless to say, this is very database intensive.

#1

cwgordon7 - March 26, 2008 - 20:52

This stems from the fact that & is not a valid character in a url. You can disallow it in node titles for this reason.

#2

cwgordon7 - March 26, 2008 - 20:53
Category:bug report» support request

Furthermore, I don't think this bug is solvable, because & would cause it to treat the following as a GET parameter.

Marking as support request. Disallow & from titles via the wikitools administration page.

#3

chrism2671 - April 1, 2008 - 10:39
Category:support request» bug report

I disagree- there are some cases when an ampersand is unavoidable, for example, when using a company name, such as [[Ernst & Young]], as we are. Ampersand is handled perfectly on mediawiki, even when using url-rewrites.

URLs should be properly url encoded and not be dependant on the characters used in the node title.

#4

peter panes - January 27, 2009 - 11:04

I agree this is a problem within Drupal and/or various modules that needs fixing.

I'm getting this problem when uploading Images (containing ampersand) with the Imagefield Module, the images simply do not show on the node or in a view.

If this can not be fixed then the option to strip ampersand should be available by default.

#5

cwgordon7 - June 18, 2009 - 04:05

I'm sorry, this is really weird. I think you need to double escape the ampersand to make it work (%2526). I hope this works/helps until I find a more permanent solution.

 
 

Drupal is a registered trademark of Dries Buytaert.