X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fhtmloutputter.php;h=b1aae16fad7a0819b634c4069b60d85837a92c52;hb=c6b1b3e5e3ad1c47c7bd25b5bcfb0a8cb1cb2bb5;hp=b341d14958b44c04615924644d36fd73a1513afe;hpb=3ed56730581e78911f5a98ff4a817e7fc2ab3bfc;p=quix0rs-gnu-social.git diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index b341d14958..b1aae16fad 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -108,10 +108,17 @@ class HTMLOutputter extends XMLOutputter header('Content-Type: '.$type); + // Output anti-framing headers to prevent clickjacking (respected by newer + // browsers). + if (common_config('javascript', 'bustframes')) { + header('X-XSS-Protection: 1; mode=block'); // detect XSS Reflection attacks + header('X-Frame-Options: SAMEORIGIN'); // no rendering if origin mismatch + } + $this->extraHeaders(); if (preg_match("/.*\/.*xml/", $type)) { // Required for XML documents - $this->xw->startDocument('1.0', 'UTF-8'); + $this->startXML(); } $this->xw->writeDTD('html', '-//W3C//DTD XHTML 1.0 Strict//EN', @@ -166,27 +173,37 @@ class HTMLOutputter extends XMLOutputter * a cluster of elements, including a