Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Encode del.icio.us link ampersands
Howdy folks. I’m working on a redesign of my photoblog here. Lots of work let to do, but it’s time for me to start trying to validate. I’m running into a problem with my ampersands, namely that they are not encoded. I’m using MagpieRSS and the txp.icio.us plugin for my blogroll. I know there’s a couple of different ways to encode special characters using PHP like this one but I don’t know how to use it. Can I wrap htmlspecialchars around something in the plugin? Or perhaps I could hack one of the php files in the /include/ directory.
Any help?
Thanks,
Chris
-Chris
chrisfenison.com
Offline
#2 2005-12-16 08:23:44
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Encode del.icio.us link ampersands
You’d need to update the plugin itself. You can request the author to do it, or you can do it yourself:
- Go to the plugin tab, find the txp.icio.us plugin, and click on the link next to it named “edit”.
- Find line 56, which looks like:
$url = $item['link'];
- Replace that with incorrect code removed, see followup post
Last edited by Mary (2005-12-16 09:52:25)
Offline
Re: Encode del.icio.us link ampersands
You are awesome. Thanks for the quick response. I can see what the line you gave me was trying to go, but it doesn’t quite work. It’s replacing the entire URL with an ampersand. I assume chr(38), ‘&’ is the part which turn an unencoded ampersand into an encoded one, but something doesnt seem to be working.
Maybe I didn’t make it clear that it’s the URLs that have the bad ampersands. Although, it appears that’s what you were trying to fix since you asked me to edit “$url” which I assume is the URL. :)
Any ideas?
-Chris
chrisfenison.com
Offline
#4 2005-12-16 09:50:56
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Encode del.icio.us link ampersands
Whoopsie, gotta get them parameters in the right order. I’m awake, really I am… Ugh, and my ampsersand got bunged up when I posted too.
Replace: $url = $item['link'];
with: $url = str_replace(chr(38), '&', $item['link']);
Offline
Re: Encode del.icio.us link ampersands
SWEET! That did it. Thanks so much. I’m sure others will find this thread useful. Hopefully we’ve metioned all the terms people would be searching for.
-Chris
chrisfenison.com
Offline
Pages: 1