if ( $upgrade ) {
$this->upgrading = true;
// Defer updates unless in auto-commit CLI mode
- DeferredUpdates::addCallableUpdate( function() {
+ DeferredUpdates::addCallableUpdate( function () {
$this->upgrading = false; // avoid duplicate updates
try {
$this->upgradeRow();
* @return int
*/
public function getWidth( $page = 1 ) {
+ $page = (int)$page;
+ if ( $page < 1 ) {
+ $page = 1;
+ }
+
$this->load();
if ( $this->isMultipage() ) {
* @return int
*/
public function getHeight( $page = 1 ) {
+ $page = (int)$page;
+ if ( $page < 1 ) {
+ $page = 1;
+ }
+
$this->load();
if ( $this->isMultipage() ) {
if ( $handler ) {
$metadata = MediaWiki\quietCall( 'unserialize', $props['metadata'] );
+ if ( !is_array( $metadata ) ) {
+ $metadata = [];
+ }
+
$options['headers'] = $handler->getContentHeaders( $metadata );
} else {
$options['headers'] = [];