check whether the sorting algorithm specified via BSTRs is intended for us before...
[citadel.git] / webcit / subst.c
index 20ff89bf7654185354f269046cf237fb119ba403..bfffef3f4cbf88aa07b7b0922035f4f3f8f25035 100644 (file)
@@ -2229,8 +2229,10 @@ void tmpl_iterate_subtmpl(StrBuf *Target, WCTemplputParams *TP)
                        if (GetHash(SortHash, SKEY(BSort), &vSortBy) &&
                            (vSortBy != NULL)) {
                                SortBy = (SortStruct*)vSortBy;
+                               /* first check whether its intended for us... */
+                               if ((SortBy->ContextType == It->ContextType)&&
                                /** Ok, its us, lets see in which direction we should sort... */
-                               if (havebstr("SortOrder")) {
+                                   (havebstr("SortOrder"))) {
                                        int SortOrder;
                                        SortOrder = LBSTR("SortOrder");
                                        if (SortOrder != 0)