Does anyone know if there is a plugin that will take a URL like:
http://www.isixsigma.com/offsite.asp?A=Fr&Url=http://www.personneltoday.com/articles/2009/01/13/48943/hr-survival-guide-for-2009-how-to-get-the-best-out-of-your-budget.html
and change the unencoded ampersand into & as well as change whatever other symbols are necessary for this to validate properly.
This URL is being pulled in from a magpie feed and it seems to leave all the symbols unencoded and the page fails validation.
Thanks in advance!
I tried valid URL but it insists on putting an extra http:// on the front. I don’t think you can stop it from doing that…. at least it doesn’t seem to have an option to stop that. I suppose I could try some sort of “trim” plugin to take out the http://, but that just seems a bit like overkill.
I also tried a find and replace plugin, but that didn’t work either.
I’ll take a look at the encode/decode thing. Never saw that before.
Thanks to you both.
Hello again Mark,
That is a super cool plugin, but it appears to work TOO well. This is what it does to my link:
href=”{magpie:link}”
because this is how I have to put it in…. surrounding an EE variable:
href=”{exp:np_encodedecode style="url" direction="encode"}{magpie:link}{/exp:np_encodedecode}
So, it seems to just convert the {,},and the : from my variable, making it no longer a variable.
Cool plugin though. Any ideas how I can get around this?
Thanks again, Shannon
Note: I notice when this displays it’s making the link above display a {,}, : but the plugin does encode them properly in my html source code. The EE forum just converted them back because I didn’t wrap it in <pre><code> tags on here.
Ok, I thought I might have solved my problem by adding parse=”inward” to my magpie plugin, but it still doesn’t work….
Here is my code.
The encodedecode plugin tries to work on {magpie:link} literally, rather than the actual link produced by magpie. Why would EE be ignoring my parse=”inward” parameter?
Last update, as I finally got it to work.
My problem with my parse=”inward” parameter was that I had copied it out of the docs somewhere and pasted it in, so it was using curly quotes and this is a no-no. If I just typed it in it all worked fine.
I eventually solved the validation problem by modifying the encode-decode plugin Mark suggested. The problem with the plugin was that it encoded too much and then the URL would no longer lead to the correct location. I did a very minor edit on the php of the plugin so that I am using the htmlspecialchars php function, rather than the urlencode php function in the plugin.
Anyway, if anyone has similar troubles, I can let you know how I altered the code. It was pretty easy. All works now and the page validates just fine.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.