X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/5c1ae3bc9c3a3cbed192fed2d68fc9b7bbe5c96f..9d61799376c6d4a51b5386ddb432693ad31129a6:/server/actions.c diff --git a/server/actions.c b/server/actions.c index 961fdec..2468b77 100644 --- a/server/actions.c +++ b/server/actions.c @@ -33,7 +33,7 @@ static void redirect(const char *url) { /* By default use the 'back' argument */ if(!url) url = cgi_get("back"); - if(url) { + if(url && *url) { if(strncmp(url, "http", 4)) /* If the target is not a full URL assume it's the action */ url = cgi_makeurl(config->url, "action", url, (char *)0); @@ -731,13 +731,15 @@ void dcgi_expand(const char *name, int header) { const char *p, *found; /* Parse macros first */ - if((found = mx_find("macros.tmpl"))) + if((found = mx_find("macros.tmpl", 1/*report*/))) + mx_expand_file(found, sink_discard(), 0); + if((found = mx_find("user.tmpl", 0/*report*/))) mx_expand_file(found, sink_discard(), 0); /* For unknown actions check that they aren't evil */ if(!dcgi_valid_action(name)) fatal(0, "invalid action name '%s'", name); byte_xasprintf((char **)&p, "%s.tmpl", name); - if(!(found = mx_find(p))) + if(!(found = mx_find(p, 0/*report*/))) fatal(errno, "cannot find %s", p); if(header) { if(printf("Content-Type: text/html\n"