aboutsummaryrefslogtreecommitdiffstats
path: root/includes/parser
diff options
context:
space:
mode:
Diffstat (limited to 'includes/parser')
-rw-r--r--includes/parser/Parser.php6
-rw-r--r--includes/parser/ParserCache.php5
-rw-r--r--includes/parser/ParserOptions.php1
3 files changed, 8 insertions, 4 deletions
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index a4e9058c2d48..6efa1f268f71 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3700,7 +3700,7 @@ class Parser {
global $wgMaxTocLevel, $wgContLang, $wgHtml5, $wgExperimentalHtmlIds;
$doNumberHeadings = $this->mOptions->getNumberHeadings();
- $showEditLink = $this->mOptions->getEditSection();
+
# Do not call quickUserCan unless necessary
if ( $showEditLink && !$this->mTitle->quickUserCan( 'edit' ) ) {
@@ -3708,8 +3708,10 @@ class Parser {
}
# Inhibit editsection links if requested in the page
- if ( isset( $this->mDoubleUnderscores['noeditsection'] ) || $this->mOptions->getIsPrintable() ) {
+ if ( isset( $this->mDoubleUnderscores['noeditsection'] ) ) {
$showEditLink = 0;
+ } else {
+ $showEditLink = $this->mOptions->getEditSection();
}
# Get all headlines for numbering them and adding funky stuff like [edit]
diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php
index 20de904a992e..1f0458b0a725 100644
--- a/includes/parser/ParserCache.php
+++ b/includes/parser/ParserCache.php
@@ -41,8 +41,9 @@ class ParserCache {
$user = $popts->mUser;
$printable = ( $popts->getIsPrintable() ) ? '!printable=1' : '';
$hash = $user->getPageRenderingHash();
- if( !$article->mTitle->quickUserCan( 'edit' ) ) {
- // section edit links are suppressed even if the user has them on
+
+ if( ! $popts->getEditSection() ) {
+ // section edit links have been suppressed
$edit = '!edit=0';
} else {
$edit = '';
diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php
index 71377e311d34..977803f55c04 100644
--- a/includes/parser/ParserOptions.php
+++ b/includes/parser/ParserOptions.php
@@ -165,6 +165,7 @@ class ParserOptions {
$this->mExternalLinkTarget = $wgExternalLinkTarget;
$this->mIsPreview = false;
$this->mIsSectionPreview = false;
+ $this->mIsPrintable = false;
wfProfileOut( __METHOD__ );
}