Project:ModSecurity false positive affecting Page Forms

From Azeroth Gazetteer
Revision as of 5:19 PM, November 5, 2026 by Beornulf (talk | contribs) (Beornulf moved page Project:Page Forms citation bug to Project:ModSecurity false positive affecting Page Forms without leaving a redirect: New information about the source)
Jump to navigation Jump to search

ModSecurity false positive affecting Page Forms documents a reproducible problem on Azeroth Gazetteer involving the Page Forms extension and citations entered into template fields. Under PHP 8.4.27, literal <ref>...</ref> citations could trigger HTTP 500 (Internal Server Error) during form preview or saving. Switching to PHP 8.3.36 allowed simple references to work, but did not eliminate the problem: further tests isolated failures involving apostrophe-formatted wiki links and reference tags. The equivalent content works through the ordinary source editor. Two alternatives have rendered successfully in Page Forms previews: the self-contained {{#tag:ref|...}} syntax and self-closing named references (<ref name="source" />) whose definitions are present elsewhere on the page. Only #tag:ref has been verified through saving and reopening.

This is a record of observed behaviour and locally tested workarounds, not a confirmed identification of the faulty extension or function.

  • First documented here: 5 November 2026
  • Status: Unresolved; PHP 8.3.36 narrows, but does not eliminate, the observed failures; #tag:ref verified through save and reopen
  • Affected workflow: Editing template parameters through Page Forms
  • Preferred workaround: {{#tag:ref|citation}} (self-contained)
  • Additional preview-tested alternatives: <ref name="source" /> (requires a matching definition); moving apostrophe formatting inside a wiki-link label in one tested arrangement

Software environment

The following software versions were reported from Azeroth Gazetteer on 5 November 2026. PHP was changed during testing; the other listed versions were not reported to have changed:

Component Installed version
MediaWiki 1.45.3
PHP 8.4.27 (initial tests); 8.3.36 (follow-up tests)
Page Forms 6.0.11
Cargo 3.9.4
Cite Version not declared in Special:Version

Cite is installed and functional, but the installation's Special:Version interface does not supply a numerical Cite version. No Cite version is inferred. These details describe the local environment and do not by themselves establish which component causes the failure. The PHP downgrade altered which reference-markup patterns succeeded; it did not conclusively identify a PHP defect or fix the underlying issue.

Symptoms

The problem has appeared in more than one form or template. During the initial PHP 8.4.27 investigation, a literal reference entered into certain Page Forms fields caused an HTTP 500 error when either Preview or Save was selected. Removing the reference allowed the form to proceed normally. Under PHP 8.3.36, simple literal references worked, while particular combinations of reference tags and formatted wiki links still caused failure (see the follow-up tests below).

The failure is not a general inability to use templates in a form field: ordinary transclusions, including {{df}}, have worked. Nor does the Cite extension fail everywhere on the wiki: references in the article body work through normal source editing.

The clearest reproduction occurred while editing Blackened Woods using Form:Location, in the Former name(s) field. An earlier incident affected a citation for Falstad Wildhammer in the current-ruler information of Wildhammer Clan.

Reproduction on Blackened Woods

In Form:Location, the relevant input is defined as:

{{{field|fname|input type=textarea|rows=2}}}

Its value is passed to Template:Locationbox, which displays the parameter and also passes it to Cargo as Former_name, declared as Wikitext string.

To reproduce the failure:

  1. Open Blackened Woods using Edit with form.
  2. Enter a citation in Former name(s), for example:
Eversong Forest<ref>Test citation</ref>
  1. Select Preview or Save.

Observed result with PHP 8.4.27 (5 November 2026): This simple test produced HTTP 500. Removing the <ref>...</ref> element avoided the failure. With PHP 8.3.36, the same simple reference succeeded. It is therefore not a reliable reproduction case on both PHP versions.

The same citation works when placed directly into the fname template parameter through the ordinary source editor. Ordinary editing worked both with normal Cargo storage and with the template's existing nocargo=yes switch. This narrows the failure to the form-editing workflow, though it does not independently establish whether the fault lies in Page Forms, an interaction between extensions, or the server's handling of that path.

No corresponding application error was identified in the available DreamHost panel logs. Unrelated Apache AH01630 access-denied messages for forbidden.html did not coincide with the failed edits. The precise PHP exception or fatal error remains unknown.

Follow-up tests under PHP 8.3.36

On 5 November 2026, the hosting control panel was used to change PHP from 8.4.27 to 8.3.36. No concurrent update to MediaWiki, Page Forms, Cargo, or Cite was reported. An initial preview with a literal reference and a template transclusion succeeded, suggesting the issue might have disappeared. Further tests showed that the error still occurred with specific markup combinations.

The following fifteen tests used the Former name(s) field in Form:Location while editing Blackened Woods. They were reported as successful or failing during the Page Forms preview workflow; the tests do not establish that all successful combinations were also saved and reopened. No underlying PHP exception was captured.

Test Markup arrangement Preview result
1 Two consecutive plain <ref> elements Works
2 Italicised wiki link inside <ref>, followed by year and chapter Fails
3 {{df}} inside <ref> Works
4 Wiki link inside <ref>, without italics Works
5 Italicised plain text inside <ref>, without a wiki link Works
6 Italicised wiki link inside <ref>, without other citation text Fails
7 Italicised wiki link immediately before a plain reference Fails
8 Italicised wiki link alone, without any reference Works
9 Plain reference before italicised wiki link, separated by a space Works
10 Italicised wiki link before plain reference, separated by a space Fails
11 Plain reference immediately before italicised wiki link Works
12 Ordinary wiki link before plain reference Works
13 Italicised plain text before plain reference Works
14 Bold wiki link before plain reference Fails
15 Wiki link with an italicised display label before a plain reference Works

The following minimal examples demonstrate the most important distinctions. In these samples, ''[[Tides of Darkness]]'' and '''[[Tides of Darkness]]''' mean apostrophe-based formatting around the whole wiki link.

Fails: formatting encloses the wiki link inside a reference (test 6).

Eversong Forest<ref>''[[Tides of Darkness]]''</ref>

Fails: formatting encloses the wiki link before a reference, even with intervening whitespace (test 10).

Eversong Forest ''[[Tides of Darkness]]'' <ref>Test citation</ref>

Fails: bold wiki link before a reference (test 14).

Eversong Forest '''[[Tides of Darkness]]''' <ref>Test citation</ref>

Works: reverse the order, placing the reference before the italicised link (test 11).

Eversong Forest<ref>Test citation</ref>''[[Tides of Darkness]]''

Works: put italics inside the wiki link's display label (test 15).

Eversong Forest [[Tides of Darkness|''Tides of Darkness'']] <ref>Test citation</ref>

Interpretation: These results support an order-sensitive interaction between literal reference tags and apostrophe formatting around wiki links. Neither ordinary wiki links nor italicised text alone caused the problem in the tested arrangements. Both bold and italic formatting around the whole link failed when the formatted link preceded a reference. Moving the formatting inside a link label succeeded in the one tested arrangement. This identifies a useful reproduction pattern, not the faulty extension or parser function. In particular, the results do not establish whether changing PHP itself, the restart of the PHP execution environment, or another version-specific behaviour explains the difference from the initial PHP 8.4.27 tests.

Additional preview-tested formatting alternative

When a source field needs an italicised wiki link followed by a reference, the following arrangement succeeded under PHP 8.3.36:

[[Tides of Darkness|''Tides of Darkness'']] <ref>Test citation</ref>

This retains a literal <ref>...</ref> element, but moves italics inside the link label. It has only been tested in the displayed order and spacing, and only during preview. It does not address the case of an italicised wiki link inside the reference itself. It should therefore be treated as a narrow alternative, not a replacement for the more thoroughly tested #tag:ref workaround.

Verified workaround

Use MediaWiki's #tag syntax to construct the reference instead of typing a literal opening and closing ref tag into the Page Forms field.

Instead of:

Eversong Forest<ref>Citation text</ref>

Use:

Eversong Forest{{#tag:ref|Citation text}}

The workaround also accepts tested citations containing other templates. Under PHP 8.3.36, #tag:ref continued to work in preview. For example:

Eversong Forest{{#tag:ref|{{df}}, pp. 152–153}}

Verified on Blackened Woods: The alternative syntax rendered citations correctly in preview, allowed the page to be saved, remained present when the page was reopened through Edit with form, and allowed subsequent previews without an error. It was subsequently used to restore the missing Falstad Wildhammer citation in Wildhammer Clan.

This is standard MediaWiki parser-function syntax, not a Gazetteer-specific extension or a change to the Cite extension. MediaWiki's documentation notes that #tag processes enclosed template calls differently from literal XML-style tags.[1]

For now, prefer the self-contained #tag:ref form in affected Page Forms fields. Ordinary <ref>...</ref> citations can continue to be used in article prose when editing normally. The workaround is verified for the tested cases, not guaranteed for every field or extension combination.

Named references and self-closing tags

MediaWiki permits a citation to be defined in one place and reused elsewhere with a self-closing tag such as <ref name="source" />.[2] Historical Page Forms release notes also mention a fix concerning self-closing tags.

Verified in preview on Blackened Woods (5 November 2026): With the full named references defined elsewhere on the page, the following text was entered into the Former name(s) field of Form:Location:

Eversong Forest<ref name="one" /><ref name="two" />

Selecting Preview succeeded without an HTTP 500 error. The preview displayed two linked reference numbers after Eversong Forest in the infobox and displayed the corresponding citations under Endnotes. In this test, the citations referred to Tides of Darkness (2007), chapter 14, and Dark Factions (2008), pages 152–153. The screenshot also showed references to the same notes in the article body, producing multiple backlinks in the endnotes.

For example, the full citation definitions could be supplied in relevant article prose:

The earlier name is attested in the sources.<ref name="one">''[[Tides of Darkness]]'' (2007), ch. 14</ref><ref name="two">{{df}}, pp. 152–153</ref>

Limits of this test: Successful Preview is confirmed. Saving and reopening the form with these self-closing tags has not yet been independently verified. This alternative requires the matching full definitions to remain on the same page; removing or renaming a definition can leave an undefined named reference. Accordingly, {{#tag:ref|...}} remains the preferred workaround when a citation should be self-contained and local to the infobox field.

A distinct Cargo issue: UNIQ markers

During the investigation, a separate problem was confirmed in the Locations Cargo table: the stored Source values for Kalidar and Nighthaven included internal reference placeholders such as UNIQ--ref-00000008-QINU, although the pages' raw wikitext contained valid <ref>...</ref> citations.

The Source field is declared as Wikitext, whereas Former_name is declared as Wikitext string. These facts may matter to the parsing and storage behaviour, but the observations do not prove that field type is the cause of either problem.

Do not conflate the two symptoms.

  • HTTP 500 on form preview/save: A request fails while processing a Page Forms edit containing a literal reference tag.
  • UNIQ markers in Cargo results: A page may render normally while Cargo stores or returns an internal parser placeholder instead of usable reference markup.

A January 2026 MediaWiki discussion specifically attributed a similar UNIQ-marker problem to Cargo's storage of partially parsed ref and pre content, correcting an earlier suspicion about Page Forms.[3]

No change to Cargo field declarations, infobox templates, or Page Forms settings was necessary to use the verified citation workaround.

The following material describes related difficulties, not confirmed duplicates of the current HTTP 500 failure:

  • December 2014: A Semantic Forms (the former name of Page Forms) user reported that a literal reference in a textarea became a UNIQ...ref...QINU marker after saving. Direct editing worked. Yaron Koren discussed the report, but no publicly documented resolution appears in that discussion.[4]
  • April–May 2020: Page Forms 4.9 improved handling of tags such as nowiki and syntaxhighlight in template fields. Version 4.9.1 specifically fixed handling of self-closing tags such as <ref />. These release notes do not establish a fix for paired reference tags in the present environment.[5]
  • July 2021: A MediaWiki support discussion recommended #tag:ref to avoid a reference-expansion problem in templates; the original reporter confirmed that it worked.[6]
  • September 2025–March 2026: Wikimedia task T406042 reported a different Page Forms HTTP 500 failure involving templates inside pre tags and PHP memory exhaustion. A patch was merged in March 2026 and the task was subsequently marked resolved. It should not be assumed to fix this citation problem.[7]

Outstanding questions

  • Does the Cite extension have a distinct release or commit identifier relevant to the installation? Special:Version does not declare a Cite version; the other software versions have been recorded above.
  • What PHP exception or fatal error causes the HTTP 500? The hosting panel's available logs did not establish this.
  • Why did changing from PHP 8.4.27 to PHP 8.3.36 allow simple references while leaving more complex failures? Was PHP behaviour itself responsible, or did the runtime restart or another environmental difference contribute?
  • Is the failure reproducible in a minimal Page Forms installation without Cargo, or is an extension interaction required?
  • Can the newly isolated link-formatting/reference patterns be reproduced on a minimal Page Forms installation, and do they also fail in other input types or fields?
  • Do the preview-tested self-closing named-reference tags and the reformatted wiki-link alternative survive Save and reopening the form?
  • Does Cargo store reference text correctly when the corresponding page was saved through Page Forms using #tag:ref? Successful rendering alone does not establish correct Cargo storage.

The PHP 8.3.36 tests narrowed the failing combinations without establishing a root cause. Until the underlying error is identified, prefer the proven #tag:ref save-and-reopen workaround; treat the self-closing and link-label alternatives as preview-tested only, and avoid unnecessary modifications to the live Cargo schema or templates.

Endnotes

  1. ↑ MediaWiki: Help:Magic words, section on #tag; see also Help:XML-style tags
  2. ↑ MediaWiki: Help:Cite, section on multiple uses of the same footnote
  3. ↑ MediaWiki: Extension talk:Page Forms, Jonathan3, 13 January 2026
  4. ↑ MediaWiki: Extension talk:Page Forms, September–December 2014 archive, section “<ref></ref> transformed to UNIQ…” (26–30 December 2014)
  5. ↑ MediaWiki: Extension:Page Forms/Version history, entries for versions 4.9 and 4.9.1
  6. ↑ MediaWiki support desk: “Extension Cite: references-tag does not work in Templates for me”, 6–7 July 2021
  7. ↑ Wikimedia Phabricator T406042, including its March 2026 event history