getgrav/grav · error · RuntimeException

400

400

Error message

Page content resolves to disallowed markup (%s) after Twig processing. Remove the render-time-assembled tag or attribute.

What it means

Error "Page content resolves to disallowed markup (%s) after Twig processing. Remove the render-time-assembled tag or attribute." thrown in getgrav/grav.

Source

Thrown at system/src/Grav/Common/Page/Page.php:1363

        }

        return null;
    }

    /**
     * Save page if there's a file assigned to it.
     *
     * @param bool|array $reorder Internal use.
     */
    public function save($reorder = true)
    {
        // Render-time XSS backstop for assembled content Twig, mirroring the Flex
        // save path (PageObject::onBeforeSave). Belt-and-suspenders for the legacy
        // save path — reject before writing if the editor's content resolves to
        // flagged markup once its Twig is processed. (GHSA-2c4f-86xc-cr74)
        $found = Security::detectXssInEditorContent($this->rawMarkdown(), $this);
        if ($found !== null) {
            throw new RuntimeException(
                sprintf('Page content resolves to disallowed markup (%s) after Twig processing. Remove the render-time-assembled tag or attribute.', $found),
                400
            );
        }

        // Perform move, copy [or reordering] if needed.
        $this->doRelocation();

        $file = $this->file();
        if ($file) {
            $file->filename($this->filePath());
            $file->header((array)$this->header());
            $file->markdown($this->rawMarkdown());
            $file->save();
        }

        // Perform reorder if required
        if ($reorder && is_array($reorder)) {

View on GitHub (pinned to 6040efed04)

When it happens

Trigger: Thrown at system/src/Grav/Common/Page/Page.php:1363 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17). Data as JSON: /api/errors/e8f0a16e71f1f91a. Report an issue: GitHub.