Page MenuHomePhabricator

Special:Upload adding duplicate header
Closed, ResolvedPublicBUG REPORT

Description

When using Special:Upload over the last ~2 days, the following header line is added to the beginning of the wikitext, even when it is already included in the wikitext given by the user:

== {{int:filedesc}} ==

See for example this file, where the upload comment shows only one header line in the wikitext, but a second line was added by the software.

This exact same issue occurred 8 years ago:
T187302

Event Timeline

Mr._Starfleet_Command changed the task status from Open to In Progress.Sep 5 2026, 10:55 PM
Mr._Starfleet_Command claimed this task.
Mr._Starfleet_Command triaged this task as High priority.
Mr._Starfleet_Command updated the task description. (Show Details)

Change #1328367 had a related patch set uploaded (by Mr. Starfleet Command; author: Mr. Starfleet Command):

[mediawiki/core@master] Follow section headers by single newline instead of double newline

https://gerrit.wikimedia.org/r/1328367

@Pi.1415926535 Thanks for reporting, @Umherirrender thanks for adding me!

I believe this issue can be fixed by tweaking the code to add a single newline after headers instead of adding two as is currently done. Luckily I already had just such a patch as a WIP for other reasons, but now that I know about this issue I've updated its commit message and marked it as active.

Huh, I wonder why my ping of Pi.1415926535 didn't work. Oh-well.

Change #1337332 had a related patch set uploaded (by Mr. Starfleet Command; author: Mr. Starfleet Command):

[mediawiki/extensions/GrowthExperiments@master] Update unit tests to use correct header spacing

https://gerrit.wikimedia.org/r/1337332

Change #1337384 had a related patch set uploaded (by Mr. Starfleet Command; author: Mr. Starfleet Command):

[mediawiki/extensions/GrowthExperiments@master] Temporarily remove unit tests involving header spacing

https://gerrit.wikimedia.org/r/1337384

Change #1337384 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Temporarily remove unit tests involving header spacing

https://gerrit.wikimedia.org/r/1337384

Change #1328367 merged by jenkins-bot:

[mediawiki/core@master] Follow section headers by single newline instead of double newline

https://gerrit.wikimedia.org/r/1328367

Change #1337332 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Update unit tests to use correct header spacing

https://gerrit.wikimedia.org/r/1337332