From 0deae76002da0c6a23c8ca7987c4b19591d46379 Mon Sep 17 00:00:00 2001 From: fowr <89118232+perdedora@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:57:31 -0300 Subject: [PATCH] allow customization of securimage by captcha config variable --- inc/config.php | 5 ++++- securimage.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/config.php b/inc/config.php index f177f9e1..32766045 100644 --- a/inc/config.php +++ b/inc/config.php @@ -390,7 +390,10 @@ // Custom captcha extra field (eg. charset) 'extra' => 'abcdefghijklmnopqrstuvwxyz', // New thread captcha. Require solving a captcha to post a thread. - 'new_thread_capt' => false + 'new_thread_capt' => false, + // Securimage customization options + // https://github.com/dapphp/securimage/blob/nextgen/examples/securimage_show_example.php#L49 + 'securimage_options' => ['send_headers' => false, 'no_exit' => true] ] ]; diff --git a/securimage.php b/securimage.php index 2d06066e..f5e5a81c 100644 --- a/securimage.php +++ b/securimage.php @@ -22,7 +22,7 @@ switch ($mode) { header("Content-type: application/json"); $extra = $config['captcha']['native']['extra']; $cookie = rand_string(20, $extra); - $i = new Securimage(['send_headers' => false, 'no_exit' => true]); + $i = new Securimage($config['captcha']['native']['securimage_options']); $i->createCode(); ob_start(); $i->show();