Created
May 20, 2015 15:28
-
-
Save anonymous/fcf4c2f110e6da045333 to your computer and use it in GitHub Desktop.
Hide referrers with Keitaro TDS. Just place file hide_referrer.php with code below to application/redirects/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @redirectName HIDE REFERER | |
* @redirectWeight 100 | |
*/ | |
class hide_referrer_redirect extends AbstractRedirect2 | |
{ | |
public function go(Stream $stream, Visitor $visitor) | |
{ | |
$this->setContent($this->_gethideRedirect($stream, $visitor)); | |
} | |
private function _gethideRedirect(Stream $stream, Visitor $visitor) | |
{ | |
$code = '<script> | |
function go() { | |
window.frames[0].document.body.innerHTML = \'<form target="_parent" method="post" action="' . $stream->getUrlWithParams($visitor) . '"></form>\'; | |
window.frames[0].document.forms[0].submit() | |
} | |
</script> | |
<iframe onload="window.setTimeout(\'go()\', 99)" src="about:blank" style="visibility:hidden"></iframe>'; | |
return $code ; | |
} | |
public function goDebug(Stream $stream, Visitor $visitor) | |
{ | |
return "Redirecting to: " . $stream->getUrlWithParams($visitor); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment