X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsubst.c;h=54a59a425487e7ec8c45c9a5997dfb5c367fc922;hb=d8ffbdf6d717dc1f2ffa82920cefc1a3048b07bc;hp=4048579ed244c31d4d65b7c126f6638808723508;hpb=814d4bec141c8374ef72a60aeeded0d696483c5e;p=citadel.git diff --git a/webcit/subst.c b/webcit/subst.c index 4048579ed..54a59a425 100644 --- a/webcit/subst.c +++ b/webcit/subst.c @@ -1016,6 +1016,25 @@ WCTemplateToken *NewTemplateSubstitute(StrBuf *Buf, switch (NewToken->Flags) { case 0: /* If we're able to find out more about the token, do it now while its fresh. */ + pch = NewToken->pName; + while (pch < NewToken->pName + NewToken->NameEnd) + { + if (((*pch >= 'A') && (*pch <= 'Z')) || + ((*pch >= '0') && (*pch <= '9')) || + (*pch == ':') || + (*pch == '-') || + (*pch == '_')) + pch ++; + else + { + LogTemplateError( + NULL, "Token Name", ERR_NAME, &TP, + "contains illegal char: '%c'", + *pch); + pch++; + } + + } if (GetHash(GlobalNS, NewToken->pName, NewToken->NameEnd, &vVar)) { HashHandler *Handler; Handler = (HashHandler*) vVar;