Merge "Remove "only newlines in trailer" special case for category/language links"
[lhc/web/wiklou.git] / includes / EditPage.php
index cd63f3e..f49157f 100644 (file)
@@ -822,8 +822,15 @@ class EditPage {
         * @return bool
         */
        protected function previewOnOpen() {
-               $previewOnOpenNamespaces = $this->context->getConfig()->get( 'PreviewOnOpenNamespaces' );
+               $config = $this->context->getConfig();
+               $previewOnOpenNamespaces = $config->get( 'PreviewOnOpenNamespaces' );
                $request = $this->context->getRequest();
+               if ( $config->get( 'RawHtml' ) ) {
+                       // If raw HTML is enabled, disable preview on open
+                       // since it has to be posted with a token for
+                       // security reasons
+                       return false;
+               }
                if ( $request->getVal( 'preview' ) == 'yes' ) {
                        // Explicit override from request
                        return true;