• Resolved Covi

    (@covi)


    If you have a script to block the iframing capture technique, the Theme Preview (I think it uses thickbox) doesn’t work.

    Does any elegant idea?, by checking referer perhaps?

    S!, srry lang.

Viewing 1 replies (of 1 total)
  • Thread Starter Covi

    (@covi)

    Ok, my solution in case someone needs it:

    <?php
    // Comprobamos el referer para no bloquear el preview de themes propio:
    if ( isset($_SERVER['HTTP_REFERER']) && '' != $_SERVER['HTTP_REFERER'] )
    	$realReferer = parse_url($_SERVER['HTTP_REFERER']);
    	$selfReferer = parse_url($siteurl);
    	//DEBUG: echo $realReferer['host'] . ' = ' . $selfReferer['host'];
    	if ($realReferer['host'] != $selfReferer['host']) :
    ?>
    <!-- Prevent your web under iframes -->
    <script type="text/javascript">
    //<![CDATA[
    	//DEBUG: alert('No frames active.');
    	if (self.parent.frames.length != 0)
    	self.parent.location=document.location.href;
    //]]>
    </script>
    <?php endif;

    Hope it is useful.
    S!

Viewing 1 replies (of 1 total)
  • The topic ‘Preview iframe issue’ is closed to new replies.