mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-11-24 08:14:37 +00:00
Couple of minor bits of code simplfication
Change-Id: Ibb7f4da745997e1a9899ea306edb9721ee0a575a
This commit is contained in:
parent
02d4236d1a
commit
636de72aae
|
@ -61,10 +61,9 @@ class PdfHandler extends ImageHandler {
|
|||
*/
|
||||
function validateParam( $name, $value ) {
|
||||
if ( in_array( $name, array( 'width', 'height', 'page' ) ) ) {
|
||||
return ( $value <= 0 ) ? false : true;
|
||||
} else {
|
||||
return false;
|
||||
return ( $value > 0 );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -339,13 +338,7 @@ class PdfHandler extends ImageHandler {
|
|||
*/
|
||||
function getPageText( $image, $page ) {
|
||||
$data = $this->getMetaArray( $image, true );
|
||||
if ( !$data ) {
|
||||
return false;
|
||||
}
|
||||
if( !isset( $data['text'] ) ) {
|
||||
return false;
|
||||
}
|
||||
if( !isset( $data['text'][$page - 1] ) ) {
|
||||
if ( !$data || !isset( $data['text'] ) || !isset( $data['text'][$page - 1] ) ) {
|
||||
return false;
|
||||
}
|
||||
return $data['text'][$page - 1];
|
||||
|
|
Loading…
Reference in a new issue