From dbfe9c99d3f7c91f103e89c299c3bc5d18db8667 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Mon, 15 May 2017 11:12:44 +0100 Subject: [PATCH] Introduce wgRelevantPageIsProbablyEditable This is equivalent to the existing variable wgIsProbablyEditable and in keeping with wgRelevantPageName/wgRelevantArticleId; this is done as an alternative to making a breaking change to the semantics of the former, as that might cause issues for users who expect wgIsProbablyEditable to return true on [[Foo]], but false on [[Special:Move/Foo]] and similar. Change-Id: I6c6ca1cfd93e7be917952980f1e1d57aec3a1292 --- includes/OutputPage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 85610b9a5b..bab52a360c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3221,6 +3221,10 @@ class OutputPage extends ContextSource { $vars['wgIsProbablyEditable'] = $title->quickUserCan( 'edit', $user ) && ( $title->exists() || $title->quickUserCan( 'create', $user ) ); + $vars['wgRelevantPageIsProbablyEditable'] = $relevantTitle + && $relevantTitle->quickUserCan( 'edit', $user ) + && ( $relevantTitle->exists() || $relevantTitle->quickUserCan( 'create', $user ) ); + foreach ( $title->getRestrictionTypes() as $type ) { $vars['wgRestriction' . ucfirst( $type )] = $title->getRestrictions( $type ); } -- 2.20.1