Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/63120
Change subject: (bug 42722) Show Protect Feedback (action=protect) for pages in
whitelisted namespaces only
......................................................................
(bug 42722) Show Protect Feedback (action=protect) for pages in whitelisted
namespaces only
Bug: 42722
Change-Id: Ibcb2a78d51332df1ab805890a34aef5e07c1a142
---
M ArticleFeedbackv5.hooks.php
1 file changed, 13 insertions(+), 2 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5
refs/changes/20/63120/1
diff --git a/ArticleFeedbackv5.hooks.php b/ArticleFeedbackv5.hooks.php
index e661153..4476873 100644
--- a/ArticleFeedbackv5.hooks.php
+++ b/ArticleFeedbackv5.hooks.php
@@ -607,7 +607,13 @@
* @return bool
*/
public static function onProtectionForm( Page $article, &$output ) {
- global $wgLang, $wgUser;
+ global $wgLang, $wgUser, $wgArticleFeedbackv5Namespaces;
+
+ // only on pages in namespaces where it is enabled
+ if ( !in_array( $article->getTitle()->getNamespace(),
$wgArticleFeedbackv5Namespaces ) ) {
+ return true;
+ }
+
$permErrors = $article->getTitle()->getUserPermissionsErrors(
'protect', $wgUser );
if ( wfReadOnly() ) {
$permErrors[] = array( 'readonlytext',
wfReadOnlyReason() );
@@ -752,7 +758,12 @@
* @return bool
*/
public static function onProtectionSave( Page $article, &$errorMsg ) {
- global $wgRequest;
+ global $wgRequest, $wgArticleFeedbackv5Namespaces;
+
+ // only on pages in namespaces where it is enabled
+ if ( !in_array( $article->getTitle()->getNamespace(),
$wgArticleFeedbackv5Namespaces ) ) {
+ return true;
+ }
$requestPermission = $wgRequest->getVal(
'articlefeedbackv5-protection-level' );
$requestExpiry = $wgRequest->getText(
'articlefeedbackv5-protection-expiration' );
--
To view, visit https://gerrit.wikimedia.org/r/63120
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibcb2a78d51332df1ab805890a34aef5e07c1a142
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits