ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

This javascript currently breaks in the forum if it outputs curly brackets...

August 08, 2012 6:26pm

Subscribe [2]
  • #1 / Aug 08, 2012 6:26pm

    kokako

    57 posts

    This bug has really got me confused, mainly because it seems to have appeared, then got fixed and then appeared again.

    That is, it got (hot)fixed for some of the afflicted… I was never abe to fix it.

    The bug centers around a block of code contained in EE_Typography.php.

    The first hot fix suggested to remove the curly brackets in the code.

    Now, the code comments say it breaks if it outputs curly brackets…

    Within the forum I am working on, there are posts that contain email addresses and these posts have no curly brackets whatsoever in them and I am still seeing the “JavaScript must be enabled to view this email address” error ...


    Also why is there a period(.) preceding the echo lang statement in the first line? This gets output to the user for no apparent reason….


    Build Date: 20120606

    /* CAREFUL
     *
     * This javascript currently breaks in the forum if it outputs curly brackets. 
     * Test if you change it.
     * 
     * Leave the comments in the while (--j >= 0) loop. They make sure that when 
     * the line breaks are removed EE doesn't see {if…
     *
     * Regex speed hat tip: <a href="http://blog.stevenlevithan.com/archives/faster-trim-javascript">http://blog.stevenlevithan.com/archives/faster-trim-javascript</a>
    */ ?>
    
    <span>.<?php echo lang('encoded_email'); ?></span>[removed]
    /*<![CDATA[*/
    var out = '',
     el = document.getElementsByTagName('span'),
     l = ['<?php echo implode("','", $bit)?>'],
     i = l.length,
     j = el.length;
    
    while (--i >= 0)
    {
     out += unescape(l[i].replace(/^\s\s*/, '&#'));
    }
    
    while (--j >= 0)
    {/**/
     if (el[j].getAttribute('<?php echo $span_marker ?>'))
     {
      el[j][removed] = out;
     }
    }
    /*]]>*/
    [removed]<?php
    
      $buffer = ob_get_contents();
      ob_end_clean(); 
    
      return str_replace(array("\n", "\t"), '', $buffer);  
     }
  • #2 / Aug 09, 2012 3:49pm

    Shane Eckert

    7174 posts

    Hello


    I am sorry to hear you are running into this problem.

    To which bug are you referring to? Is it 18107?

    If it is, there is currently no hotfix listed. I think it’s an old bug but a new bug at the same time.

    I see you commented on one of the duplicates, but I would comment on the bug I listed above. Hopefully a hot fix will be made available soon. I am really sorry about the trouble it’s causing you.

    Thank you,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases