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

Tgr created this task.May 7 2018, 11:41 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 7 2018, 11:41 AM

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).

Tgr added a comment.May 7 2018, 2:35 PM

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

daniel added a subscriber: daniel.EditedMay 9 2018, 5:45 PM

@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.

Vvjjkkii renamed this task from Prevent substing of {{REVISION*}} to mhdaaaaaaa.Jul 1 2018, 1:11 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
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.