When adding in categories to the contact list, most characters can be used without a problem. However, I have noticed that three characters in particular do cause a problem if they are present in a category name, and that category link is clicked on:

  • The plus sign (+) causes the page to redirect to itself (only once - it does not get stuck in an infinite loop).
  • The slash (/) does the same as the plus sign, but is not encoded in the URL containing it (it's shown as "/" instead of "%2F").
  • The backslash (\) generates a 404 error. What's interesting about this is that - in this case - the error is from the server instead of from Drupal.

Out of curiosity, I added one category which was a string of every ASCII character available in the "Character Map" in Windows (broken up into 20 characters per line here - the soft hyphen isn't visible, but it's there):

!"#$%&'()*+,-./01234
56789:;<=>?@ABCDEFGH
IJKLMNOPQRSTUVWXYZ[\
]^_`abcdefghijklmnop
qrstuvwxyz{|}~€‚ƒ„…†
‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œž
Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²
³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆ
ÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚ
ÛÜÝÞßàáâãäåæçèéêëìíî
ïðñòóôõö÷øùúûüýþÿ

When the three characters mentioned above were removed, the string worked just fine. Could there be an issue with how they are encoded that is causing issues with contact category links containing those characters?

Comments

behindthepage’s picture

This is an issue for the core contact module and if you post it under drupal someone will give you an intelligent answer.

Wolfey’s picture

All right, then - thank you for mentioning that. Before I post it there, though, I noticed one of the things they mention on the "Submit Issue" page is to list how to reproduce the issue...and I can't figure out a way (short of already having your module installed) to reproduce this issue just for the core content module.

behindthepage’s picture

So are you saying it doesn't happen with the core contact module but it does happen with mine?

behindthepage’s picture

Ok I finally get it. The problem is with the links on the "contact/list" page. Of course the simple solution is don't use these characters. However it may be a weakness in Drupals code that you have spotted. BTW Good testing and definition of the problem.

There are a couple of places that this could be happening or fixed.

  1. Where the Categories are entered which is part of the core contact module.
  2. In the "L" function that themes links which is part of core.
  3. or I could add in some code to my module that would parse those characters

The question has to be asked whether anyone would want to use those characters and whether it is a good idea to use them. Personally I don't know and I think this will need to be answered by some of the Drupal Gurus.

Wolfey’s picture

Yes - it happens with your module, but not with the core contact module Could this be a case where the problem can only be (easily) exposed with the addition of another module? If so, that would explain why I thought it was your module that had the issue at first. I wonder if other modules that add features to contact.module are also affected by this?

As for the problem testing and definition, thanks for the compliment :)

As for the use of those three characters in category names...In my opinion, I can't see a justifiable use for backslashes or plus signs in a category, unless they were used as part of a ranking system of some sort. Slashes, however, would definitely be useful, mainly where a person/position carries multiple titles that are all part of the same job and can't be listed separately.

I'll repost this as an issue with Drupal regarding the contact.module component now - thank you for your help.

behindthepage’s picture

Status: Active » Closed (fixed)

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 52509)