Page MenuHomePhabricator

Prevent substing of {{REVISION*}}
Open, Needs TriagePublic

Description

{{subst:REVISIONID}} cannot work: substing (pre-save transform) happens before the revision ID would be assigned. Substing other revision-related magic words could work in theory, but would require some cache resets that we are not doing.

Currently if someone attempts these the page just silently ends up with a potentially incorrect value. The save should be properly rejected instead.

Event Timeline

Please don't hurt {{subst:REVISIONID: {{subst:FULLPAGENAME}} }} which is used as {{<includeonly>subst:</includeonly>REVISIONID: {{<includeonly>subst:</includeonly>FULLPAGENAME}} }} in some ruwiki templates, inserting the last known revision ID in order to generate &direction=next link for the viewer which will point to the newly saved revision (for example).

As I said, constructs like that do not work reliably (and might work even less reliably in the future, as much of the article storage layer is being refactored).

Okay, but so far it has worked stably.

The caches are reset at the moment using the vary-revision flag inside the Parser. Substitution of the variable would give you the values of the new revision, substitution of the REVISION* parser function will give you the values of the current pre-safe revision (as used in ruwiki)

See T8181 or T13964 or T14694
This task seems a duplicate of seem

@Umherirrender that cache reset fixes {{REVISIONID}}, but not {{subst:REVISIONID}}. The reset causes a re-parse, but does not re-run the PST that resolves the subst. It can't: the content has already been written to the database.

CommunityTechBot renamed this task from mhdaaaaaaa to Prevent substing of {{REVISION*}}.Jul 2 2018, 4:22 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.