Page MenuHomePhabricator

Magic word returning protection expiry
Closed, ResolvedPublic

Description

Kind of follow-up to T11947, it would be very practical to have variables returning the expiration date for a protection, e.g. {{PROTECTIONEXPIRY:edit}}, and returning indefinite if the protection is indefinite.

Expiries are often forgotten in protection templates, or wrongly applied. This would make the precision of expiry automated.

Details

Event Timeline

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

lunasantin wrote:

(patched against r63544)

Outputs a timestamp if the page is protected ("infinity" if protection is indef), or an empty string if the page is not currently protected.

As a side note, this is my first patch submission. Be gentle?

attachment 17354.diff ignored as obsolete

lunasantin wrote:

patched against r64623

Submitting a revised patch, per feedback from #mediawiki

Change is now made in CoreParserFunctions.php, so that protectionexpiry will be next to and in the same style as the pre-existing protectionlevel function.

Attached:

sumanah wrote:

Luna, I apologize for the wait! Thanks for the patch. Are you interested in updating it and in using developer access to directly suggest it into our Git source control system?

https://www.mediawiki.org/wiki/Developer_access

https://www.mediawiki.org/wiki/Git/Workflow#How_to_submit_a_patch

I'll submit a patch based on lunasantin's.

Change 255717 had a related patch set uploaded (by Cenarium):
Add magic word for protection expiry

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

Change 255717 merged by jenkins-bot:
Add magic word for protection expiry

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

Umherirrender changed the task status from Open to Stalled.Oct 29 2016, 2:22 PM
Umherirrender assigned this task to Cenarium.