Couple of minor bits of code simplfication

Change-Id: Ibb7f4da745997e1a9899ea306edb9721ee0a575a
This commit is contained in:
Reedy 2013-01-31 10:50:00 +00:00
parent 02d4236d1a
commit 636de72aae

View file

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