Welcome Guest, Not a member yet? Register   Sign In
TinyMCE and Email Addresses
#1

[eluser]charlie spider[/eluser]
Hi everyone,

Just uploading my first CI site that I built in the evenings and on weekends (ie: I'm no pro) and can't figure this bug out.

The site has a CMS backend for it that uses the TinyMCE editor for the main text blocks on each page of the site. I can write some content into the editor, save it to the database and display it on the main site no problem.

However...

If the content contains an email address, TinyMCE wants to convert it to something like this:

//<![CDATA[
var l=new Array();
l[0]='>';l[1]='a';l[2]='/';l[3]='<';l[4]='|97';l[5]='|99';l[6]='|46';l[7]='|119';l[8]='|97';l[9]='|104';l[10]='|115';l[11]='|64';l[12]='|114';l[13]='|101';l[14]='|100';l[15]='|110';l[16]='|101';l[17]='|112';l[18]='|110';l[19]='|111';l[20]='|101';l[21]='|115';l[22]='|117';l[23]='|111';l[24]='|104';l[25]='>';l[26]='"';l[27]='|97';l[28]='|99';l[29]='|46';l[30]='|119';l[31]='|97';l[32]='|104';l[33]='|115';l[34]='|64';l[35]='|114';l[36]='|101';l[37]='|100';l[38]='|110';l[39]='|101';l[40]='|112';l[41]='|110';l[42]='|111';l[43]='|101';l[44]='|115';l[45]='|117';l[46]='|111';l[47]='|104';l[48]=':';l[49]='o';l[50]='t';l[51]='l';l[52]='i';l[53]='a';l[54]='m';l[55]='"';l[56]='=';l[57]='f';l[58]='e';l[59]='r';l[60]='h';l[61]=' ';l[62]='a';l[63]='<';
for (var i = l.length-1; i >= 0; i=i-1){
if (l[i].substring(0, 1) == '|') [removed]("&#"+unescape(l[i].substring(1))+";");
else [removed](unescape(l[i]));}
//]]>

which gets converted back to regular text when the page is viewed in the browser, but remains as above in the source code so that presumably spam-bots won't be able to read the email address.

That's fine.

The problem is if I edit or resave a page that has one of these javascript converted email addresses in it, it no longer reconverts the email address to regular text in the browser, and the webpage viewer sees the same goobly-gook as shown above.

The site is already a little late being launched so any help pointing me in the right direction would be super greatly appreciated.

Thanks


Messages In This Thread
TinyMCE and Email Addresses - by El Forum - 01-12-2008, 06:06 PM
TinyMCE and Email Addresses - by El Forum - 01-12-2008, 11:09 PM
TinyMCE and Email Addresses - by El Forum - 01-13-2008, 12:16 AM
TinyMCE and Email Addresses - by El Forum - 01-16-2008, 12:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB