1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Only look for admin include if no local found

This switches the behaviour introduced with the last commit
so that now the admin folder is only checked for includes if
in the specified path none is found.
This commit is contained in:
Marvin Scholz 2015-02-25 16:11:42 +01:00
parent 5b416b311c
commit 0709b4e66d

View File

@ -207,16 +207,19 @@ static xmlDocPtr custom_loader(const xmlChar *URI,
xsltStylesheet *c;
ice_config_t *config;
final_URI = xmlStrdup(URI);
struct stat file;
switch (type) {
/* In case an include is loaded */
case XSLT_LOAD_STYLESHEET:
/* Not look in admindir if the include file exists */
if (stat((char *)URI, &file) == 0)
break;
c = (xsltStylesheet *) ctxt;
/* Check if we actually have context/path */
if (ctxt == NULL || c->doc->URL == NULL)
break;
rel_path = xmlBuildRelativeURI(URI, c->doc->URL);
if (rel_path != NULL && admin_path != NULL) {
struct stat file;
fn = xmlBuildURI(rel_path, admin_path);
if (fn != NULL && stat((char *)fn, &file) == 0) {
final_URI = fn;