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
This commit is contained in:
Kunal Mehta 2021-09-03 01:07:49 -07:00
parent 2328f802b1
commit bbb15eb87c

View file

@ -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