From: James D. Forrester Date: Mon, 15 May 2017 10:12:44 +0000 (+0100) Subject: Introduce wgRelevantPageIsProbablyEditable X-Git-Tag: 1.31.0-rc.0~3233^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=dbfe9c99d3f7c91f103e89c299c3bc5d18db8667;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); }