summaryrefslogtreecommitdiff
path: root/includes/parser/ParserOutput.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/parser/ParserOutput.php')
-rw-r--r--includes/parser/ParserOutput.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index 502f0fd1..460f3211 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -55,6 +55,7 @@ class ParserOutput extends CacheTime {
private $mExtensionData = array(); # extra data used by extensions
private $mLimitReportData = array(); # Parser limit report data
private $mParseStartTime = array(); # Timestamps for getTimeSinceStart()
+ private $mPreventClickjacking = false; # Whether to emit X-Frame-Options: DENY
const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
@@ -330,6 +331,7 @@ class ParserOutput extends CacheTime {
$this->addModuleMessages( $out->getModuleMessages() );
$this->mHeadItems = array_merge( $this->mHeadItems, $out->getHeadItemsArray() );
+ $this->mPreventClickjacking = $this->mPreventClickjacking || $out->getPreventClickjacking();
}
/**
@@ -629,4 +631,15 @@ class ParserOutput extends CacheTime {
function setLimitReportData( $key, $value ) {
$this->mLimitReportData[$key] = $value;
}
+
+ /**
+ * Get or set the prevent-clickjacking flag
+ *
+ * @since 1.24
+ * @param boolean|null $flag New flag value, or null to leave it unchanged
+ * @return boolean Old flag value
+ */
+ public function preventClickjacking( $flag = null ) {
+ return wfSetVar( $this->mPreventClickjacking, $flag );
+ }
}