Hi,
If you look at the _custom_breadcrumbs_create_crumb function, the way it calls the l() function breaks HTML entities. For example, I have page titles with ampersands in them. Drupal core does not check_plain() node titles because they've been sanitised already - it just spits them straight out. Problem is, the l() function checks them again and ends up over-checking HTML entities. As such, I end up with page title like this:
Science & Technology
And breadcrumb like this:
Home -> Discussion -> Science & Technology
Doh! I got around this by adding array('html' => TRUE) in to your implementation of the l() function, but if this is not desired we could move the actual link creation to a theme function so people can at least override it if they need to and not hack the module?
Hope that makes sense! =)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 691512-custom_breadcrumb_fix_entities.patch | 772 bytes | greg.harvey |
Comments
Comment #1
greg.harveyThinking about it, my problem is I'm using the Page Title module to show the breadcrumbs. I guess if this were a "normal" set-up I would use the
[title-raw]token, instead of the[title]and the problem would go away. Trouble is, I don't think there is a[page-title-raw]function (but I'm off to check now). For sure, running this through a theme function would be best so we can alter as needs be, if a module doesn't provide a raw token. =)Comment #2
greg.harveyUpdating title.
Related issue at Page Title queue: #691520: Create a [page-title-raw] token
Comment #3
MGN commentedIn custom breadcrumbs 6.x-2.x this was fixed by adding the following line at the beginning of the _custom_breadcrumbs_create_crumb() function
See #318272: Decode of title suggested to handle special characters for the original issue and the drupal 6 api for information on decode entities. Looks like I bumped the fix to 6.x-2.x and failed to implement it in 6.x-1.x.
Could you try that with the current 6.x-1.x code and verify that this fixes the problem. Since it parallels the 6.x-2.x code, that would be the best solution.
Comment #4
greg.harveyWorks for me, here's a patch.
But for the record, if there was a -raw token for Page Titles I would never have reported this bug, so that's probably valid too. Always use the -raw token, if available, because Custom Breadcrumbs will check and filter anyway. =)
Comment #5
MGN commentedWhat version are you working from? Doesn't look like the most recent code...
I've committed a fix to 6.x-1.x-dev that parallels the 6.x-2.x-dev code. It looks like it is already fixed in D5 (5.x-1.x-dev) as well.
http://drupal.org/cvs?commit=318120
Thanks
Comment #6
greg.harveySorry, it's not ... it's 6.x-1.4 ... needs updating, I know, but I did check the dev snapshot before I raised an issue. ;-)