diff --git a/core/captcha.php b/core/captcha.php index 56b9ec50..c731ab6e 100644 --- a/core/captcha.php +++ b/core/captcha.php @@ -3,6 +3,8 @@ * CAPTCHA abstraction * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +use ReCaptcha\ReCaptcha; + function captcha_get_html(): string { global $config, $user; @@ -37,7 +39,7 @@ function captcha_check(): bool if ($user->is_anonymous() && $config->get_bool("comment_captcha")) { $r_privatekey = $config->get_string('api_recaptcha_privkey'); if (!empty($r_privatekey)) { - $recaptcha = new \ReCaptcha\ReCaptcha($r_privatekey); + $recaptcha = new ReCaptcha($r_privatekey); $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']); if (!$resp->isSuccess()) { diff --git a/core/extension.php b/core/extension.php index d2bea604..d464b578 100644 --- a/core/extension.php +++ b/core/extension.php @@ -395,7 +395,7 @@ abstract class DataHandlerExtension extends Extension throw new UploadException("Unable to scan media properties: ".$e->getMessage()); } - $ire = send_event(new ImageReplaceEvent($image_id, $image)); + send_event(new ImageReplaceEvent($image_id, $image)); $event->image_id = $image_id; } else { $image = $this->create_image_from_data(warehouse_path(Image::IMAGE_DIR, $event->hash), $event->metadata); @@ -453,6 +453,7 @@ abstract class DataHandlerExtension extends Extension { global $page; if ($this->supported_ext($event->image->ext)) { + /** @noinspection PhpPossiblePolymorphicInvocationInspection */ $this->theme->display_image($page, $event->image); } } diff --git a/core/install.php b/core/install.php index f9219cc1..e85299e4 100644 --- a/core/install.php +++ b/core/install.php @@ -61,8 +61,10 @@ function get_dsn() { if (file_exists("data/config/auto_install.conf.php")) { $dsn = null; + /** @noinspection PhpIncludeInspection */ require_once "data/config/auto_install.conf.php"; } elseif (@$_POST["database_type"] == DatabaseDriver::SQLITE) { + /** @noinspection PhpUnhandledExceptionInspection */ $id = bin2hex(random_bytes(5)); $dsn = "sqlite:data/shimmie.{$id}.sqlite"; } elseif (isset($_POST['database_type']) && isset($_POST['database_host']) && isset($_POST['database_user']) && isset($_POST['database_name'])) { @@ -136,7 +138,7 @@ function ask_questions()