Skip to content

Commit

Permalink
Only prepend 'css/' when given a filename without path
Browse files Browse the repository at this point in the history
Commit 1819bbd 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
  • Loading branch information
dregad authored and vboctor committed Jul 9, 2016
1 parent 2f06326 commit 1643e47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/html_api.php
Expand Up @@ -388,7 +388,11 @@ function html_css() {
* @return void
*/
function html_css_link( $p_filename ) {
echo "\t", '<link rel="stylesheet" type="text/css" href="', string_sanitize_url( helper_mantis_url( 'css/' . $p_filename ), true ), '" />' . "\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", '<link rel="stylesheet" type="text/css" href="', string_sanitize_url( helper_mantis_url( $p_filename ), true ), '" />' . "\n";
}


Expand Down

0 comments on commit 1643e47

Please sign in to comment.