From 1fa82581b68a8aef4129039017659f4f65d4b0d5 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 14 Aug 2017 05:47:25 +0000 Subject: [PATCH] Avoid warning --- include/plugin.php | 2 ++ index.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/plugin.php b/include/plugin.php index 1ea3ed73d1..4dd79b521a 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -544,6 +544,8 @@ function upgrade_bool_message($bbcode = false) { * @return string Path to the file or empty string if the file isn't found */ function theme_include($file, $root = '') { + $file = basename($file); + // Make sure $root ends with a slash / if it's not blank if ($root !== '' && $root[strlen($root)-1] !== '/') { $root = $root . '/'; diff --git a/index.php b/index.php index 9ddb47efc6..e67ace1326 100644 --- a/index.php +++ b/index.php @@ -498,7 +498,7 @@ if (isset($_GET["mode"])) { } // If there is no page template use the default page template -if (!$template) { +if (empty($template)) { $template = theme_include("default.php"); } -- 2.39.2