From ef819f6c3035e7bf244c7d3419624921c753ab2c Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Tue, 11 Aug 2020 19:07:41 -0500 Subject: [PATCH] Prevent multiple includes of ThumbLib Fixes this error: ``` Constant THUMBLIB_BASE_PATH already defined /e107/e107_handlers/phpthumb/ThumbLib.inc.php:31 /e107/e107_handlers/media_class.php:1943 /e107/e107_handlers/mail.php:1269 /e107/e107_handlers/mail.php:654 /e107/e107_handlers/mail.php:976 /e107/e107_tests/tests/unit/e107EmailTest.php:61 ``` --- e107_admin/image.php | 2 +- e107_handlers/media_class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_admin/image.php b/e107_admin/image.php index a2c2dc682..78a78752f 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -98,7 +98,7 @@ if(vartrue($_GET['action']) == 'nav' && e_AJAX_REQUEST) //XXX Doesn't work corre } - require(e_HANDLER.'phpthumb/ThumbLib.inc.php'); // For resizing on import. + require_once(e_HANDLER.'phpthumb/ThumbLib.inc.php'); // For resizing on import. $e_sub_cat = 'image'; diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php index ba021f3f2..83cad4119 100644 --- a/e107_handlers/media_class.php +++ b/e107_handlers/media_class.php @@ -1940,7 +1940,7 @@ class e_media } - @require(e_HANDLER.'phpthumb/ThumbLib.inc.php'); + require_once(e_HANDLER.'phpthumb/ThumbLib.inc.php'); try { $thumb = PhpThumbFactory::create($src);