]> code.citadel.org Git - citadel.git/blobdiff - webcit/subst.c
* conditionals mustn't have 0 as id; fix the ones who have and add another errormessage.
[citadel.git] / webcit / subst.c
index 05f03c6b925d0bf658915418d88a16ef26cbe57b..ca532a469566e6cd0fc1ecea299b729098c212cf 100644 (file)
@@ -934,6 +934,15 @@ WCTemplateToken *NewTemplateSubstitute(StrBuf *Buf,
        case SV_CUST_STR_CONDITIONAL:
        case SV_CONDITIONAL:
        case SV_NEG_CONDITIONAL:
+               if (NewToken->Params[1]->lvalue == 0) {
+                       lprintf(1, "Conditional (in '%s' line %ld); "
+                               "Conditional ID mustn't be 0! [%s]\n", 
+                               ChrPtr(pTmpl->FileName),
+                               NewToken->Line,
+                               ChrPtr(NewToken->FlatToken));
+                       NewToken->Flags = 0;
+                       break;
+               }
                if (NewToken->nParameters <2) {
                        lprintf(1, "Conditional (in '%s' line %ld); "
                                "require at least 2 parameters, you gave %ld params [%s]\n",