Aaron Schulz has submitted this change and it was merged.
Change subject: Couple of minor bits of code simplfication
......................................................................
Couple of minor bits of code simplfication
Change-Id: Ibb7f4da745997e1a9899ea306edb9721ee0a575a
---
M PdfHandler_body.php
1 file changed, 3 insertions(+), 10 deletions(-)
Approvals:
Aaron Schulz: Verified; Looks good to me, approved
diff --git a/PdfHandler_body.php b/PdfHandler_body.php
index f54b1dc..73ce1b5 100644
--- a/PdfHandler_body.php
+++ b/PdfHandler_body.php
@@ -61,10 +61,9 @@
*/
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 @@
*/
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];
--
To view, visit https://gerrit.wikimedia.org/r/46917
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb7f4da745997e1a9899ea306edb9721ee0a575a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PdfHandler
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits