Skip to content

Commit

Permalink
Fix highlightjs_style in config.php being ignored (#1039)
Browse files Browse the repository at this point in the history
highlightjs_style variable is being used before config.php gets parsed, so preview style is always vs. This PR fixes that by moving config.php parsing to be before external resource calls.
  • Loading branch information
bmsurber committed May 11, 2023
1 parent 7ec19c1 commit dabc4ea
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tinyfilemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@
'::' // non-routable meta ipv6
);

// if User has the external config file, try to use it to override the default config above [config.php]
// sample config - https://tinyfilemanager.github.io/config-sample.txt
$config_file = __DIR__.'/config.php';
if (is_readable($config_file)) {
@include($config_file);
}

// External CDN resources that can be used in the HTML (replace for GDPR compliance)
$external = array(
'css-bootstrap' => '<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">',
Expand All @@ -158,13 +165,6 @@
'pre-cloudflare' => '<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin/><link rel="dns-prefetch" href="https://cdnjs.cloudflare.com"/>'
);

// if User has the external config file, try to use it to override the default config above [config.php]
// sample config - https://tinyfilemanager.github.io/config-sample.txt
$config_file = __DIR__.'/config.php';
if (is_readable($config_file)) {
@include($config_file);
}

// --- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL ---

// max upload file size
Expand Down

0 comments on commit dabc4ea

Please sign in to comment.