From: Meitar Moscovitz Date: Mon, 16 Feb 2009 04:45:18 +0000 (+1100) Subject: Add framebusting JavaScript to help avoid clickjacking attacks. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9d81cef5cc2a0a197a0223206ba3d9a687065886;p=quix0rs-gnu-social.git Add framebusting JavaScript to help avoid clickjacking attacks. --- diff --git a/lib/action.php b/lib/action.php index cd0db53999..48d5821a17 100644 --- a/lib/action.php +++ b/lib/action.php @@ -205,6 +205,9 @@ class Action extends HTMLOutputter // lawsuit $this->element('script', array('type' => 'text/javascript', 'src' => common_path('js/util.js?version='.LACONICA_VERSION)), ' '); + // Frame-busting code to avoid clickjacking attacks. + $this->element('script', array('type' => 'text/javascript'), + 'if (window.top !== window.self) { window.top.location.href = window.self.location.href; }'); Event::handle('EndShowLaconicaScripts', array($this)); } Event::handle('EndShowScripts', array($this));