Skip to content

Commit

Permalink
PHP 8 avoid possible error.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Dec 9, 2023
1 parent b970aec commit 56c8a55
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions thumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
* On-the-fly thumbnail generator
*/

define('e107_INIT', true);
const e107_INIT = true;


function thumbExceptionHandler(Exception $exception)
function thumbExceptionHandler(Throwable $exception)
{
http_response_code(500);
echo "Fatal Thumbnail Error\n";
Expand Down Expand Up @@ -93,7 +93,7 @@ function __construct()
include($self.DIRECTORY_SEPARATOR.'e107_config.php');

// support early include feature
if(isset($CLASS2_INCLUDE) && !empty($CLASS2_INCLUDE))
if(!empty($CLASS2_INCLUDE))
{
require_once(realpath(__DIR__ .'/'.$CLASS2_INCLUDE));
}
Expand Down Expand Up @@ -131,8 +131,7 @@ function __construct()
'SYSTEM_DIRECTORY',
'CORE_DIRECTORY'
);
// $sql_info = array(); //compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLcharset');
//e107::getInstance()->initCore($e107_paths, $self, $sql_info, varset($e107_CONFIG, array()));

$e107 = e107::getInstance();

$e107->site_path = substr(md5($mySQLdefaultdb.".".$mySQLprefix),0,10);
Expand All @@ -148,7 +147,7 @@ function __construct()
unset($tmp, $self);
$e107->set_urls(false);
// basic Admin area detection - required for proper path parsing
define('ADMIN', strpos(e_SELF, ($e107->getFolder('admin')) !== false || strpos(e_PAGE, 'admin') !== false));
define('ADMIN', strpos(e_SELF, (e107::getFolder('admin')) != false || strpos(e_PAGE, 'admin') !== false));

// Next function call maintains behavior identical to before; might not be needed
// See https://github.com/e107inc/e107/issues/3033
Expand Down

0 comments on commit 56c8a55

Please sign in to comment.