Roxen.git / server / modules / tags / static_resource.pike

version» Context lines:

Roxen.git/server/modules/tags/static_resource.pike:43:    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)    {    string tag_name = p->tag_name();    string attr_name = process_tags[tag_name];    string link = args[attr_name];    if(link && has_prefix (link, "/") && !has_prefix (link, "//")) { +  sscanf(link, "%s%*[?#]", string raw_link); +     array(int)|Stdio.Stat st = -  id->conf->try_stat_file(link, id); +  id->conf->try_stat_file(raw_link, id);       if(st) {    if(arrayp(st))    st = Stdio.Stat(st);       string varystr = sprintf("mtime=%d", st->mtime);       args[attr_name] =    Roxen.add_pre_state(link, (< "cache-forever", varystr >)); -  +  +  m_delete(args, "/"); +     return ({ Roxen.make_tag(tag_name, args, has_suffix (tag_name, "/"),    1) });    }    }    return 0;    };       foreach(process_tags; string tag_name; string attr_name) {    parser->add_tag(tag_name, process_tag);    parser->add_tag(tag_name + "/", process_tag);