From f0c6dec79863b3fe1f5572e181c0cbc6ee320bc2 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 11 Jan 2023 11:59:56 +0000 Subject: [PATCH] nits --- ext/bulk_import_export/main.php | 2 +- ext/handle_ico/main.php | 9 ++++----- ext/pools/test.php | 3 +-- themes/lite/page.class.php | 16 ++++------------ 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/ext/bulk_import_export/main.php b/ext/bulk_import_export/main.php index 98d8da9f..93c5b843 100644 --- a/ext/bulk_import_export/main.php +++ b/ext/bulk_import_export/main.php @@ -174,10 +174,10 @@ class BulkImportExport extends DataHandlerExtension try { $json_string = stream_get_contents($info); $json_data = json_decode($json_string); + return $json_data; } finally { fclose($info); } - return $json_data; } else { return null; } diff --git a/ext/handle_ico/main.php b/ext/handle_ico/main.php index 9a3cf255..a6c50b09 100644 --- a/ext/handle_ico/main.php +++ b/ext/handle_ico/main.php @@ -19,14 +19,13 @@ class IcoFileHandler extends DataHandlerExtension try { unpack("Snull/Stype/Scount", fread($fp, 6)); $subheader = unpack("Cwidth/Cheight/Ccolours/Cnull/Splanes/Sbpp/Lsize/loffset", fread($fp, 16)); + $width = $subheader['width']; + $height = $subheader['height']; + $event->image->width = $width == 0 ? 256 : $width; + $event->image->height = $height == 0 ? 256 : $height; } finally { fclose($fp); } - - $width = $subheader['width']; - $height = $subheader['height']; - $event->image->width = $width == 0 ? 256 : $width; - $event->image->height = $height == 0 ? 256 : $height; } protected function create_thumb(string $hash, string $mime): bool diff --git a/ext/pools/test.php b/ext/pools/test.php index bf23b7bc..67da7b48 100644 --- a/ext/pools/test.php +++ b/ext/pools/test.php @@ -79,8 +79,7 @@ class PoolsTest extends ShimmiePHPUnitTestCase /** @depends testCreate */ public function testList($args) { - [$pool_id, $image_ids] = $this->testCreate(); - + $this->testCreate(); $this->get_page("pool/list"); $this->assert_text("Pool"); } diff --git a/themes/lite/page.class.php b/themes/lite/page.class.php index a443d345..dbd0b549 100644 --- a/themes/lite/page.class.php +++ b/themes/lite/page.class.php @@ -117,20 +117,12 @@ EOD; $i = $block->id; $html = "
"; if (!is_null($h)) { - if ($salt == "main") { - $html .= ""; - } else { - $html .= ""; - } + $html .= ""; } if (!is_null($b)) { - if ($salt =="main") { - $html .= "
{$b}
"; - } else { - $html .= " - - "; - } + $html .= " + + "; } $html .= "
"; return $html;