Page MenuHomePhabricator

Preview fails when $wgRawHtml is activated
Open, Needs TriagePublic

Description

When $wgRawHtml is true, the preview in forms fails with the MediaWiki error message session_fail_preview_html (expanded below).

It should be still a bit investigated but the edit token (classically wpEditToken) is probably not provided, perhaps in an internal FauxRequest - I see there are such things in PF_AutoeditAPI.php - but there is such token provided in the API POST request action=pfautoedit, so possibly some link is missing somewhere to pass this token internally.

I’m not sure if it is linked to T189812, the patch provided there did not improved the effects of the current bug.

session_fail_preview_html
Sorry! We could not process your edit due to a loss of session data.
Because {{SITENAME}} has raw HTML enabled, the preview is hidden as a precaution against JavaScript attacks.
If this is a legitimate edit attempt, please try again. If it still does not work, try [[Special:UserLogout|logging out]] and logging back in, and check that your browser allows cookies from this site.

Versions:

  • PageForms: 4.9.3 - 02485334b54
  • MediaWiki: 1.34.1 - 65e25dd3e98