If the page contains __NOEDITSECTION__, it will never have edit sections, so don...
authorPlatonides <platonides@users.mediawiki.org>
Tue, 25 Oct 2011 22:18:33 +0000 (22:18 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Tue, 25 Oct 2011 22:18:33 +0000 (22:18 +0000)
Fix for bug 31647: Regression: __NOEDITSECTION__ is ignored when the page is read from the parser cache

includes/parser/Parser.php

index 4b7093c..e859563 100644 (file)
@@ -3883,8 +3883,9 @@ class Parser {
 
                # Inhibit editsection links if requested in the page
                if ( isset( $this->mDoubleUnderscores['noeditsection'] ) ) {
-                       $showEditLink = 0;
+                       $maybeShowEditLink = $showEditLink = false;
                } else {
+                       $maybeShowEditLink = true; /* Actual presence will depend on ParserOptions option */
                        $showEditLink = $this->mOptions->getEditSection();
                }
                if ( $showEditLink ) {
@@ -4139,7 +4140,7 @@ class Parser {
                        );
 
                        # give headline the correct <h#> tag
-                       if ( $sectionIndex !== false ) {
+                       if ( $maybeShowEditLink && $sectionIndex !== false ) {
                                // Output edit section links as markers with styles that can be customized by skins
                                if ( $isTemplate ) {
                                        # Put a T flag in the section identifier, to indicate to extractSections()