Tobias Gritschacher has uploaded a new change for review.

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

Change subject: Call checkUrlExtension() when doing pdf download
......................................................................

Call checkUrlExtension() when doing pdf download

Bug: T149782
Change-Id: I44dd79f3000ab2e4264a1ced34775aab9ebbda3a
---
M specials/SpecialElectronPdf.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ElectronPdfService 
refs/changes/40/319340/1

diff --git a/specials/SpecialElectronPdf.php b/specials/SpecialElectronPdf.php
index 53b93d4..c990e62 100644
--- a/specials/SpecialElectronPdf.php
+++ b/specials/SpecialElectronPdf.php
@@ -133,6 +133,12 @@
        }
 
        public function renderAndShowPdf( Title $title ) {
+               if ( !$this->getRequest()->checkUrlExtension() ) {
+                       $this->getOutput()->showErrorPage(
+                               'electronPdfService-page-notfound-title',
+                               'electronPdfService-page-notfound-text'
+                       );
+               }
                $tempFile = TempFSFile::factory( 'electron_', 'pdf' );
                $this->tempFileHandle = fopen( $tempFile->getPath(), 'w+' );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44dd79f3000ab2e4264a1ced34775aab9ebbda3a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ElectronPdfService
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to