Page MenuHomePhabricator

Disabling signature cleaning breaks SUBST signatures
Open, LowPublic

Description

Author: Nx.devnull

Description:
After disabling signature cleaning ($wgCleanSignatures), an editor who uses template substitution (e.g. {{SUBST:User:Example/sig}}) will leave this raw code in the wikitext when signing. The substitution will only occur the next time someone saves the text. See http://rationalwiki.com/wiki/index.php?title=RationalWiki:Technical_support&diff=prev&oldid=359262 and http://rationalwiki.com/wiki/index.php?title=RationalWiki:Technical_support&diff=prev&oldid=359290

The attached patch fixes this by allowing some of the cleaning to take place, but still allows users to have transcluded template signatures


Version: 1.16.x
Severity: minor

Details

Reference
bz23172

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:03 PM
bzimport set Reference to bz23172.
bzimport added a subscriber: Unknown Object (MLST).

Nx.devnull wrote:

Proposed patch

attachment parser_substsig.patch ignored as obsolete

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

sumanah wrote:

Thank you for your patch. Sorry for the wait in reviewing it! Could you take a look at the most current version of MediaWiki (in Subversion trunk), check the current behavior, and see if it obsoletes the bug you wanted to fix, and whether your patch still applies cleanly? Thanks!

Nx.devnull wrote:

I took a quick look at parser.php in svn and it doesn't look like anything has changed, so the patch should still apply.

Created attachment 10439
Amended patch

Attached:

A few comments on patch:

  • static function is being called non-statically
  • Unneeded strict comparison
  • Wrong spacing

I've fixed them in the new patch.

However, the main problem with this fix is that it defeats the point of $wgCleanSignatures by cleaning problematic signatures regardless of it. Adding to CC Tim Starling who originally introduced this setting at Wikia's request - Tim, will this change break anything for them?

Nx.devnull wrote:

Thanks for the fixes.

According to the documentation (https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/RELEASE-NOTES?&pathrev=38279&r1=38278&r2=38279), the point of $wgCleanSignatures=false is to disable template removal from sigs (i.e. forcing templates to be subst-ed). The patch still accomplishes that. There's no reason to allow ~~~~ and SUBST to remain in a sig, since the next edit would parse them and change them anyway.

Nx.devnull wrote:

that link failed spectacularly. r38279 change to release-notes

sumanah wrote:

Wikia folks, can you read the bug comments and let us know your current thoughts? Thanks.

Change 111126 had a related patch set uploaded by Nx:
Subst templates and clean tildes even if $wgCleanSignatures is false

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