From 5dee1fced4d51d545d85d0f18db99849ac328b98 Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 26 Oct 2014 11:09:09 +0100 Subject: no absolute pathes allowed for image type 'image', path has to start with {ressourcedir} --- libtemplate/templatefunction.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libtemplate') diff --git a/libtemplate/templatefunction.c b/libtemplate/templatefunction.c index b96f0be..4b0c66f 100644 --- a/libtemplate/templatefunction.c +++ b/libtemplate/templatefunction.c @@ -1067,8 +1067,17 @@ void cTemplateFunction::ParseStringParameters(void) { } parsedText = text.str(); - //now check further possible string variables string path = GetParameter(ptPath); + if (GetNumericParameter(ptImageType) == itImage && path.size() > 0) { + //no absolute pathes allowed + if (!startswith(path.c_str(), "{")) { + esyslog("skindesigner: no absolute pathes allowed for images - %s", path.c_str()); + } + if (startswith(path.c_str(), "{ressourcedir}")) { + imgPath = path.replace(0, 14, *config.GetSkinRessourcePath()); + } + } + //now check further possible string variables if (stringTokens && path.size() > 0 && path.find("{") != string::npos) { for (map < string, string >::iterator it = stringTokens->begin(); it != stringTokens->end(); it++) { size_t found = path.find(it->first); -- cgit v1.2.3