Robert Vogel has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/306664

Change subject: Fix for "OutputPage::setFileVersion not called in diff view"
......................................................................

Fix for "OutputPage::setFileVersion not called in diff view"

The 'ImagePage' calls the 'setFileVersion' of the current 'OutputPage'
object only at the end of method 'openShowImage'. But this method just
gets called if the page is not in 'diff' view.

In core there is no use of the 'fileVersion' field of 'OutputPage'.
But there are extensions that rely on this information. A famous example
is the FlaggedRevs extension, which uses this field to populate the review
HTML form with hidden fields. The described behavior results in a bad
parametrized HTML form and therefore in a broken functionality.

See T95261 for details

Change-Id: I1bda8b1b4178e49caf8d8c2221dfffb460b9c1da
---
M includes/page/ImagePage.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/64/306664/1

diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php
index 1396685..8258a19 100644
--- a/includes/page/ImagePage.php
+++ b/includes/page/ImagePage.php
@@ -159,6 +159,8 @@
                        $this->openShowImage();
                }
 
+               $out->setFileVersion( $this->displayImg );
+
                # No need to display noarticletext, we use our own message, 
output in openShowImage()
                if ( $this->mPage->getId() ) {
                        # NS_FILE is in the user language, but this section 
(the actual wikitext)
@@ -630,7 +632,6 @@
                                $request->response()->statusHeader( 404 );
                        }
                }
-               $out->setFileVersion( $this->displayImg );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/306664
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bda8b1b4178e49caf8d8c2221dfffb460b9c1da
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to