Page MenuHomePhabricator

autoSummChars.patch

Authored By
bzimport
Nov 21 2014, 9:32 PM
Size
1 KB
Referenced Files
None
Subscribers
None

autoSummChars.patch

Index: Article.php
===================================================================
--- Article.php (revision 19917)
+++ Article.php (working copy)
@@ -2832,12 +2832,17 @@
#New page autosummaries
if ($flags & EDIT_NEW && strlen($newtext)) {
#If they're making a new article, give its text, truncated, in the summary.
- global $wgContLang;
- $truncatedtext = $wgContLang->truncate(
- str_replace("\n", ' ', $newtext),
- max( 0, 200 - strlen( wfMsgForContent( 'autosumm-new') ) ),
- '...' );
- $summary = wfMsgForContent( 'autosumm-new', $truncatedtext );
+ global $wgAutoSummChars;
+ if ($wgAutoSummChars > 0) {
+ global $wgContLang;
+ $truncatedtext = $wgContLang->truncate(
+ str_replace("\n", ' ', $newtext),
+ max( 0, $wgAutoSummChars - strlen( wfMsgForContent( 'autosumm-new') ) ),
+ '...' );
+ $summary = wfMsgForContent( 'autosumm-new', $truncatedtext );
+ } else {
+ $summary = "";
+ }
}
if ($summary)
Index: DefaultSettings.php
===================================================================
--- DefaultSettings.php (revision 19917)
+++ DefaultSettings.php (working copy)
@@ -2457,4 +2457,10 @@
*/
$wgEnableCascadingProtection = true;
+/**
+ * Set this to "0" to disable auto-summaries.
+ * Otherwise, specify the max. number of characters for auto-summaries.
+ */
+$wgAutoSummChars = 200;
+
?>

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3141
Default Alt Text
autoSummChars.patch (1 KB)

Event Timeline