From 2b006af52db38b30a916bdf99b903eb24ed3e1b4 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Sun, 26 May 2024 16:29:35 +0100 Subject: [PATCH] 2FA QR Codes Move away from the Google Charts API for generating QR codes as this is currently broken and not a security best practice. --- plugins/barcode/barcode.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/barcode/barcode.php b/plugins/barcode/barcode.php index b1115011..1c29d10d 100644 --- a/plugins/barcode/barcode.php +++ b/plugins/barcode/barcode.php @@ -26,6 +26,10 @@ DEALINGS IN THE SOFTWARE. \****************************************************************************/ +// Check php-gd is installed +$testGD = get_extension_funcs("gd"); +if (!$testGD){ echo "The GD extension is not installed, please install using 'apt install php-gd', restart Apache, and try again"; exit; } + if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) { if (isset($_POST['s']) && isset($_POST['d'])) { $generator = new barcode_generator(); @@ -3345,4 +3349,4 @@ class barcode_generator { 119, 238, 241, 207, 179, 75, 150, 1, ); -} \ No newline at end of file +}