Branch: Tag:

2010-11-02

2010-11-02 15:20:09 by 0

Always sort markup attributes in order to get stable ETag hashes for same
content on different servers. Fixes [bug 5676 (#5676)].

Rev: server/etc/modules/RXML.pmod/module.pmod:1.418
Rev: server/etc/modules/Roxen.pmod:1.298
Rev: server/modules/js-support/javascript_support.pike:1.73

1:   // This is a roxen pike module. Copyright © 1999 - 2009, Roxen IS.   // - // $Id: Roxen.pmod,v 1.297 2010/10/29 21:56:06 mast Exp $ + // $Id: Roxen.pmod,v 1.298 2010/11/02 15:20:07 jonasw Exp $      #include <roxen.h>   #include <config.h>
1986:    };       string res = ""; +  array(string) sorted_attrs = sort(indices(in));    if (preserve_roxen_entities) { -  foreach(indices(in), string a) +  foreach(sorted_attrs, string a)    res += " " + a + "=\"" + quote_fn((string) in[a]) + "\"";    } else { -  foreach(indices(in), string a) +  foreach(sorted_attrs, string a)    res += " " + a + "=\"" + html_encode_string((string) in[a]) + "\"";    }    return res;