Welcome Guest, Not a member yet? Register   Sign In
safe_mailto problem
#1

[eluser]Perkin5[/eluser]
I have a contact link like this:

Code:
<?php echo safe_mailto('[email protected]', 'click here'); ?>

but the words 'click me' fail to show. If I delete 'safe_', in other words make it into an ordinary link, it works fine.

With safe_mailto the obfuscated code nevertheless shows up in view source.

I have jquery running but I can't see why that would be a problem.

Can anyone shed any light on why this is happening?
#2

[eluser]Perkin5[/eluser]
Seems I managed to find a problem that's foxed everybody. Can it really be that I'm the only one this has happened to and nobody can suggest a fix?

Here's the generated 'obfuscated' javascript if that helps at all:

Code:
//<![CDATA[
    var l=new Array();
    l[0]='>';l[1]='a';l[2]='/';l[3]='<';l[4]='|101';l[5]='|109';l[6]='|32';l[7]='|108';l[8]='|105';l[9]='|97';l[10]='|109';l[11]='|101';l[12]='>';l[13]='"';l[14]='|109';l[15]='|111';l[16]='|99';l[17]='|46';l[18]='|116';l[19]='|104';l[20]='|103';l[21]='|105';l[22]='|115';l[23]='|110';l[24]='|105';l[25]='|100';l[26]='|101';l[27]='|110';l[28]='|105';l[29]='|98';l[30]='|109';l[31]='|111';l[32]='|99';l[33]='|64';l[34]='|101';l[35]='|105';l[36]='|103';l[37]='|114';l[38]='|111';l[39]='|101';l[40]='|103';l[41]=':';l[42]='o';l[43]='t';l[44]='l';l[45]='i';l[46]='a';l[47]='m';l[48]='"';l[49]='=';l[50]='f';l[51]='e';l[52]='r';l[53]='h';l[54]=' ';l[55]='a';l[56]='<';
    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]));}
    //]]>

Incidentally, where in the snippet above it says [removed] the code says 'document write' with a stop in the middle!
#3

[eluser]Perkin5[/eluser]
Further to my last, I now suspect it's not safe_mail itself that's the problem. Safe_mail writes javascript code that relies on the document write function (sorry I can't write that correctly as the forum doesn't allow it). I've tried using a test js script inside the codeigniter view and I can't get document write to work at all so obviously safe_mail or auto_mail will also not work.

What can be stopping it?
#4

[eluser]Perkin5[/eluser]
Solved my own problem!

I was using Paul Irish's HTML5 Boilerplate and it includes a js plugin file that has this script:

Code:
// catch all [removed]() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){
    log('[removed](): ',arguments);
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);

I disabled it and lo! everything works.




Theme © iAndrew 2016 - Forum software by © MyBB