From 573846707ceade4d00a4dfe3184d9f8004a3112b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 19 Feb 2017 16:50:41 -0800 Subject: fix several places where head_add_(css|js) functions have been used incorrectly. It appears that mistakes were made going back a long time and propagated. Here's the way it should work: - if there is no preceding / character, we look for the file within all the appropriate theme directories. - otherwise the file should have a preceding /, which means use this path relative to the hubzilla basedir - files beginning with // are considered to be schemeless URLs. Therefore 'foo.css' means find the best theme-able representation of foo.css. '/library/foo.css' means only use the version of foo.css that is in /library. --- boot.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index a435f5ac8..7120632f4 100755 --- a/boot.php +++ b/boot.php @@ -2225,7 +2225,7 @@ function construct_page(&$a) { // Zotlabs\Render\Theme::debug(); if (($p = theme_include($current_theme[0] . '.js')) != '') - head_add_js($p); + head_add_js('/' . $p); if (($p = theme_include('mod_' . App::$module . '.php')) != '') require_once($p); @@ -2237,10 +2237,13 @@ function construct_page(&$a) { else head_add_css(((x(App::$page, 'template')) ? App::$page['template'] : 'default' ) . '.css'); - head_add_css('mod_' . App::$module . '.css'); + if (($p = theme_include('mod_' . App::$module . '.css')) != '') + head_add_css('mod_' . App::$module . '.css'); + head_add_css(Zotlabs\Render\Theme::url($installing)); - head_add_js('mod_' . App::$module . '.js'); + if (($p = theme_include('mod_' . App::$module . '.js')) != '') + head_add_js('mod_' . App::$module . '.js'); App::build_pagehead(); -- cgit v1.2.3