Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F7091
diff.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 11:14 PM
2014-11-21 23:14:59 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
diff.patch
View Options
Index: includes/Article.php
===================================================================
--- includes/Article.php (revision 82816)
+++ includes/Article.php (working copy)
@@ -647,11 +647,19 @@
* @return bool
*/
public function isCountable( $text ) {
- global $wgUseCommaCount;
+ global $wgArticleCountMethod;
- $token = $wgUseCommaCount ? ',' : '[[';
+ $isContent = $this->mTitle->isContentPage() && !$this->isRedirect( $text );
- return $this->mTitle->isContentPage() && !$this->isRedirect( $text ) && in_string( $token, $text );
+ switch ( $wgArticleCountMethod ) {
+ case 'any':
+ return $isContent;
+ case 'comma':
+ return $isContent && in_string( ',', $text );
+ case 'link':
+ default:
+ return $isContent && in_string( '[[', $text );
+ }
}
/**
Index: includes/Setup.php
===================================================================
--- includes/Setup.php (revision 82816)
+++ includes/Setup.php (working copy)
@@ -258,6 +258,11 @@
$wgAjaxExportList[] = 'SpecialUpload::ajaxGetExistsWarning';
}
+# Back-compatability for pre 1.18
+if ( $wgUseCommaCount ) {
+ $wgArticleCountMethod = 'comma';
+}
+
if ( $wgNewUserLog ) {
# Add a new log type
$wgLogTypes[] = 'newusers';
Index: includes/DefaultSettings.php
===================================================================
--- includes/DefaultSettings.php (revision 82816)
+++ includes/DefaultSettings.php (working copy)
@@ -2886,14 +2886,18 @@
/**
* Under which condition should a page in the main namespace be counted
- * as a valid article? If $wgUseCommaCount is set to true, it will be
- * counted if it contains at least one comma. If it is set to false
+ * as a valid article? If $wgArticleCountMethod is set to 'comma', it will be
+ * counted if it contains at least one comma. If it is set to 'link'
* (default), it will only be counted if it contains at least one [[wiki
- * link]]. See http://www.mediawiki.org/wiki/Manual:Article_count
+ * link]]. If set to 'any', will count any non-redirect in content namespace.
+ * See http://www.mediawiki.org/wiki/Manual:Article_count
*
* Retroactively changing this variable will not affect
* the existing count (cf. maintenance/recount.sql).
*/
+$wgArticleCountMethod = 'link';
+
+/** Back-compatability. Overides $wgArticleCountMethod if set to true. */
$wgUseCommaCount = false;
/**
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6627
Default Alt Text
diff.patch (2 KB)
Attached To
Mode
T28033: Wiktionary needs an option to include all in the article count
Attached
Detach File
Event Timeline
Log In to Comment