From ff71a89948ed2d29807a2f1615d9ccc5d5f49f29 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 3 Feb 2023 16:58:16 +0000 Subject: [PATCH] fixes --- core/extension.php | 6 ++++-- ext/blotter/main.php | 3 --- ext/bulk_actions/main.php | 2 +- ext/ouroboros_api/main.php | 2 +- ext/tag_list/main.php | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/extension.php b/core/extension.php index 88667049..eab89965 100644 --- a/core/extension.php +++ b/core/extension.php @@ -62,9 +62,11 @@ abstract class Extension public static function determine_enabled_extensions(): void { self::$enabled_extensions = []; + $extras = defined("EXTRA_EXTS") ? explode(",", EXTRA_EXTS) : []; + foreach (array_merge( ExtensionInfo::get_core_extensions(), - explode(",", EXTRA_EXTS) + $extras ) as $key) { $ext = ExtensionInfo::get_by_key($key); if ($ext===null || !$ext->is_supported()) { @@ -361,7 +363,7 @@ abstract class DataHandlerExtension extends Extension // Locked Stuff. if (!empty($event->metadata['locked'])) { $locked = $event->metadata['locked']; - send_event(new LockSetEvent($image, !empty($locked))); + send_event(new LockSetEvent($image, $locked)); } } } elseif ($supported_mime && !$check_contents) { diff --git a/ext/blotter/main.php b/ext/blotter/main.php index a3ca98aa..c62eb92a 100644 --- a/ext/blotter/main.php +++ b/ext/blotter/main.php @@ -115,9 +115,6 @@ class Blotter extends Extension $this->theme->display_permission_denied(); } else { $id = int_escape($_POST['id']); - if (!isset($id)) { - die("No ID!"); - } $database->execute("DELETE FROM blotter WHERE id=:id", ["id"=>$id]); log_info("blotter", "Removed Entry #$id"); $page->set_mode(PageMode::REDIRECT); diff --git a/ext/bulk_actions/main.php b/ext/bulk_actions/main.php index 00b5571b..4b45a08e 100644 --- a/ext/bulk_actions/main.php +++ b/ext/bulk_actions/main.php @@ -175,7 +175,7 @@ class BulkActions extends Extension if (empty($data)) { throw new BulkActionException("No ids specified in bulk_selected_ids"); } - if (is_array($data) && !empty($data)) { + if (is_array($data)) { $items = $this->yield_items($data); } } elseif (isset($_POST['bulk_query']) && $_POST['bulk_query'] != "") { diff --git a/ext/ouroboros_api/main.php b/ext/ouroboros_api/main.php index bab98c23..c2ab19b8 100644 --- a/ext/ouroboros_api/main.php +++ b/ext/ouroboros_api/main.php @@ -112,7 +112,7 @@ class OuroborosPost extends _SafeOuroborosImage * Mainly just acts as a wrapper and validation layer * @noinspection PhpMissingParentConstructorInspection */ - public function __construct(array $post, string $md5 = '') + public function __construct(array $post) { if (array_key_exists('tags', $post)) { // implode(explode()) to resolve aliases and sanitise diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 021fe730..5564376a 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -162,7 +162,7 @@ class TagList extends Extension if (is_null($results)) { $tags = explode(" ", $tags_config); - if (empty($tags)) { + if (count($tags) == 0) { return []; }