From bbb15eb87cb6db06d498626b4bd680d4e066a8c1 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 3 Sep 2021 01:07:49 -0700 Subject: [PATCH] Remove questionable PdfHandler::isEnabled() implementation The variables are set to default values in extension.json, so someone would have to manually set them to null values to trigger this check. At that point, surely you'd just disable the extension. A check like is_executable() might've made sense, however with the introduction of Shellbox, it would be totally fine for the binaries to not exist on the host where MediaWiki is running, but only in the container. So just removing the check seems like the most straightforward thing to do. Bug: T289228 Change-Id: I5da0625959fdfa01c36c955c82320dbc591b3f23 --- includes/PdfHandler.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/includes/PdfHandler.php b/includes/PdfHandler.php index 010e833..ceb1965 100644 --- a/includes/PdfHandler.php +++ b/includes/PdfHandler.php @@ -62,21 +62,6 @@ class PdfHandler extends ImageHandler { */ private const STATE_DIMENSION_INFO = 'pdfDimensionInfo'; - /** - * @return bool - */ - public function isEnabled() { - global $wgPdfProcessor, $wgPdfPostProcessor, $wgPdfInfo; - - if ( !isset( $wgPdfProcessor ) || !isset( $wgPdfPostProcessor ) || !isset( $wgPdfInfo ) ) { - wfDebug( "PdfHandler is disabled, please set the following\n" ); - wfDebug( "variables in LocalSettings.php:\n" ); - wfDebug( "\$wgPdfProcessor, \$wgPdfPostProcessor, \$wgPdfInfo\n" ); - return false; - } - return true; - } - /** * @param File $file * @return bool