Bug 1087: ESI processor not quoting attributes correctly.
Use HTML 4.01 specified double-quotes instead of HTML 1.0 single quotes
and HTML-encode any double-quotes contained within the attribute data.
assert (xstrncpy (pos, attr[i], sizeof(localbuf) + (pos - localbuf)));
pos += strlen (pos);
*pos++ = '=';
- *pos++ = '\'';
- assert (xstrncpy (pos, attr[i + 1], sizeof(localbuf) + (pos - localbuf)));
+ *pos++ = '\"';
+ const char *chPtr = attr[i + 1];
+ char ch;
+ while ((ch = *chPtr++) != '\0') {
+ if (ch == '\"') {
+ assert( xstrncpy(pos, """, sizeof(localbuf) + (pos-localbuf)) );
+ pos += 6;
+ } else {
+ *(pos++) = ch;
+ }
+ }
pos += strlen (pos);
- *pos++ = '\'';
+ *pos++ = '\"';
}
*pos++ = '>';