Branch: Tag:

2012-09-19

2012-09-19 14:39:46 by Martin Jonsson <marty@roxen.com>

Make sure not to output trailing slashes on tags that don't have one to begin with.

Fixes [Bug 6051 (#6051)].

Rev: server/modules/tags/static_resource.pike:1.2

42:    {    mapping process_tags = query("process_tags");    Parser.HTML parser = Parser.HTML(); +  parser->xml_tag_syntax(0);       function process_tag = lambda(Parser.HTML p, mapping args)    {
60:       args[attr_name] =    Roxen.add_pre_state(link, (< "cache-forever", varystr >)); -  return ({ Roxen.make_tag(tag_name, args, 1, 1) }); +  return ({ Roxen.make_tag(tag_name, args, has_suffix (tag_name, "/"), +  1) });    }    }    return 0;    };    -  foreach(process_tags; string tag_name; string attr_name) +  foreach(process_tags; string tag_name; string attr_name) {    parser->add_tag(tag_name, process_tag); -  +  parser->add_tag(tag_name + "/", process_tag); +  }       string res = parser->finish(s)->read();    parser = 0;