Matmarex has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71332
Change subject: Allow creation of empty MediaWiki: pages
......................................................................
Allow creation of empty MediaWiki: pages
This is useful now since it's possible to disable messages byblanking
them (see bug 14176).
Instead disallow creation of page contents equivalent to the default
message to serve the same purpose as disallowing blanking did (prevent
edits which wouldn't change anything anyway; the edit form is even
prefilled with the default contents).
Bug: 50124
Change-Id: I070036f341b866cda67eb928c5b74ad2ce6c527c
---
M includes/EditPage.php
1 file changed, 8 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/32/71332/1
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 84bb493..c88f32d 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -1507,8 +1507,14 @@
return $status;
}
- # Don't save a new article if it's blank.
- if ( $this->textbox1 == '' ) {
+ // Don't save a new page if it's blank or if it's a
MediaWiki:
+ // message with content equivalent to default (allow
empty pages
+ // in this case to disable messages, see bug 50124)
+ if (
+ $this->mTitle->getNamespace() === NS_MEDIAWIKI
+ ? $this->textbox1 ===
$this->mTitle->getDefaultMessageText()
+ : $this->textbox1 === ''
+ ) {
$status->setResult( false,
self::AS_BLANK_ARTICLE );
wfProfileOut( __METHOD__ );
return $status;
--
To view, visit https://gerrit.wikimedia.org/r/71332
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I070036f341b866cda67eb928c5b74ad2ce6c527c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits