ea3a67989847a2b731be271d112feab992a5eb9a galt Wed Sep 28 10:08:47 2016 -0700 Fixes hgNearTest robot by having htmlPage.c call attributeDecode on attribute values since we are now encoding them against XSS. refs #18077. hgNearTest was crashing right away with the error Couldn't get main form on orgPage. diff --git src/lib/htmlPage.c src/lib/htmlPage.c index 47a7417..b1449c2 100644 --- src/lib/htmlPage.c +++ src/lib/htmlPage.c @@ -12,30 +12,31 @@ * htmlPageSetVar(page, page->forms, "org", "Human"); * newPage = htmlPageFromForm(page, page->forms, "submit", "Go"); */ #include "common.h" #include "errAbort.h" #include "errCatch.h" #include "memalloc.h" #include "linefile.h" #include "hash.h" #include "dystring.h" #include "cheapcgi.h" #include "obscure.h" #include "filePath.h" #include "net.h" +#include "htmshell.h" #include "htmlPage.h" void htmlStatusFree(struct htmlStatus **pStatus) /* Free up resources associated with status */ { struct htmlStatus *status = *pStatus; if (status != NULL) { freeMem(status->version); freez(pStatus); } } void htmlStatusFreeList(struct htmlStatus **pList) @@ -621,30 +622,31 @@ } else if (isspace(c)) { *e++ = 0; break; } else if (c == 0) break; ++e; } } } AllocVar(att); att->name = cloneString(name); att->val = cloneString(val); + attributeDecode(att->val); slAddTail(&tag->attributes, att); s = e; if (gotEnd) break; } } } } slReverse(&tagList); return tagList; } static struct htmlFormVar *findOrMakeVar(struct htmlPage *page, char *name, struct hash *hash, struct htmlTag *tag, struct htmlFormVar **pVarList) /* Find variable of existing name if it exists, otherwise