mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 16:38:42 +00:00
config: make empty js= omit script tag
According to the cgitrc man page, an empty js= value should cause the script tag to be omitted. But instead, a script tag with an empty URL is emitted. The same applies to css. So, skip emitting a tag if the specified string is empty. Signed-off-by: Samuel Lidén Borell <samuel@kodafritt.se> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
907134b7a2
commit
00ecfaadea
@ -770,6 +770,10 @@ static void print_rel_vcs_link(const char *url)
|
|||||||
|
|
||||||
static int emit_css_link(struct string_list_item *s, void *arg)
|
static int emit_css_link(struct string_list_item *s, void *arg)
|
||||||
{
|
{
|
||||||
|
/* Do not emit anything if css= is specified. */
|
||||||
|
if (s && *s->string == '\0')
|
||||||
|
return 0;
|
||||||
|
|
||||||
html("<link rel='stylesheet' type='text/css' href='");
|
html("<link rel='stylesheet' type='text/css' href='");
|
||||||
if (s)
|
if (s)
|
||||||
html_attr(s->string);
|
html_attr(s->string);
|
||||||
@ -782,6 +786,10 @@ static int emit_css_link(struct string_list_item *s, void *arg)
|
|||||||
|
|
||||||
static int emit_js_link(struct string_list_item *s, void *arg)
|
static int emit_js_link(struct string_list_item *s, void *arg)
|
||||||
{
|
{
|
||||||
|
/* Do not emit anything if js= is specified. */
|
||||||
|
if (s && *s->string == '\0')
|
||||||
|
return 0;
|
||||||
|
|
||||||
html("<script type='text/javascript' src='");
|
html("<script type='text/javascript' src='");
|
||||||
if (s)
|
if (s)
|
||||||
html_attr(s->string);
|
html_attr(s->string);
|
||||||
|
Loading…
Reference in New Issue
Block a user