Otherwise the user will see a session failure message since their
request wasn't posted with a token, which doesn't make sense since they
just clicked on an edit link.
Bug: T172251
Change-Id: Id4a20818c737886f5a7ec72dba52c531f1ba78a0
* @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;