When using special chars, for example scandinavian ä,ö or å, in theme Switching Rule Chain. Theme does not get switched.
Example: drupal:path = path/äbc/% >>> exampleTheme
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 1264310.patch | 436 bytes | mkalkbrenner |
| #5 | urldecode-before-comparing-rule-chain-path-themekey_base.inc-1264310-4.patch | 639 bytes | tungscit |
Comments
Comment #1
tungscit commentedComment #2
tungscit commentedComment #3
tungscit commentedComment #4
tungscit commentedThe issue is caused by encoded request_uri() which lead to non-matching theme switching rule.
For example:
- if the theme switching rule chain includes drupal:path = path/äbc/% >>> exampleTheme
- User access http://www.example.com/path/äbc
- themekey_match_path() try to find a matching rule by using request_uri() to compare with db rul chain value
- request_uri() will return path/%C3%A4bc which of course will never match with db rule chain value
Comment #5
tungscit commentedUsing urldecode before comparing path alias with db path chain value should fix the issue.
Attached is the patch.
Comment #6
tungscit commentedComment #7
tungscit commentedComment #8
mkalkbrennerYou're right. But I'm concerned about backward compatibility. It could be that users already use urlencoded paths in their ThemeKey rules. And there's a difference between urlencode and rawurlencode.
What do you think about this variant of the patch?
Comment #9
tungscit commentedYes, I think your patch is better. Tested and the problem is fixed. Thanks a bunch!
Comment #10
mkalkbrennercommitted to 6.x and 7.x