From 1643e474c5762117d7583eaf571626ea35a5dac9 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Thu, 7 Jul 2016 18:03:44 +0200 Subject: [PATCH] Only prepend 'css/' when given a filename without path Commit 1819bbdf8c2d629798fa48537f9bb167e8d33005 introduced new html_css_link() function to include CSS files, but made the assumption that these would always be in the css/ directory. This lets the admin specify $g_css_include_file with a path, allowing them to store custom CSS in a different location within the MantisBT root. Fixes #21194 --- core/html_api.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/html_api.php b/core/html_api.php index 14916818bb..bdfb4a7a50 100644 --- a/core/html_api.php +++ b/core/html_api.php @@ -388,7 +388,11 @@ function html_css() { * @return void */ function html_css_link( $p_filename ) { - echo "\t", '' . "\n"; + # If no path is specified, look for CSS files in default directory + if( $p_filename == basename( $p_filename ) ) { + $p_filename = 'css/' . $p_filename; + } + echo "\t", '' . "\n"; }