Merge "Send integer ms to DB lag time guage instead of seconds"
[lhc/web/wiklou.git] / includes / parser / ParserOptions.php
index 7be8281..2cdd8c7 100644 (file)
@@ -243,6 +243,21 @@ class ParserOptions {
         */
        private $redirectTarget = null;
 
+       /**
+        * If the wiki is configured to allow raw html ($wgRawHtml = true)
+        * is it allowed in the specific case of parsing this page.
+        *
+        * This is meant to disable unsafe parser tags in cases where
+        * a malicious user may control the input to the parser.
+        *
+        * @note This is expected to be true for normal pages even if the
+        *  wiki has $wgRawHtml disabled in general. The setting only
+        *  signifies that raw html would be unsafe in the current context
+        *  provided that raw html is allowed at all.
+        * @var boolean
+        */
+       private $allowUnsafeRawHtml = true;
+
        public function getInterwikiMagic() {
                return $this->mInterwikiMagic;
        }
@@ -457,6 +472,15 @@ class ParserOptions {
        public function getMagicRFCLinks() {
                return $this->mMagicRFCLinks;
        }
+
+       /**
+        * @since 1.29
+        * @return bool
+        */
+       public function getAllowUnsafeRawHtml() {
+               return $this->allowUnsafeRawHtml;
+       }
+
        public function setInterwikiMagic( $x ) {
                return wfSetVar( $this->mInterwikiMagic, $x );
        }
@@ -596,6 +620,15 @@ class ParserOptions {
                return wfSetVar( $this->mIsPrintable, $x );
        }
 
+       /**
+        * @param bool|null Value to set or null to get current value
+        * @return bool Current value for allowUnsafeRawHtml
+        * @since 1.29
+        */
+       public function setAllowUnsafeRawHtml( $x ) {
+               return wfSetVar( $this->allowUnsafeRawHtml, $x );
+       }
+
        /**
         * Set the redirect target.
         *