Roxen.git / server / etc / modules / RXML.pmod / utils.pmod

version» Context lines:

Roxen.git/server/etc/modules/RXML.pmod/utils.pmod:1:   //! Things that belong elsewhere but can't lie there for various silly reasons.   //!   //! E.g. one reason is to avoid circular references in the parser   //! objects when the callbacks are defined in them.   //!   //! Created 2000-01-21 by Martin Stjernholm   //! - //! $Id: utils.pmod,v 1.10 2000/03/06 17:50:29 mast Exp $ + //! $Id: utils.pmod,v 1.11 2000/05/03 08:52:15 mast Exp $         array return_zero (mixed... ignored) {return 0;}   array return_empty_array (mixed... ignored) {return ({});}      int(1..1)|string|array free_text_error (Parser.HTML p, string str)   {    sscanf (str, "%[ \t\n\r]", string ws);    if (str != ws) {    sscanf (reverse (str), "%*[ \t\n\r]%s", str);
Roxen.git/server/etc/modules/RXML.pmod/utils.pmod:78:    if (!p->type->free_text) return ({});    string out;    if ((<"#x", "#X">)[entity[..1]]) {    if (sscanf (entity, "%*2s%x%*c", int c) == 2) out = (string) ({c});    }    else    if (sscanf (entity, "%*c%d%*c", int c) == 2) out = (string) ({c});    return out && ({out});    }    } -  return p->type->free_text ? 0 : ({}); +  if (!p->type->free_text) +  RXML.parse_error ("Unknown entity &%s; not allowed in this context.\n", entity); +  return 0;   }      int(1..1)|string|array p_xml_compat_entity_cb (Parser.HTML p, string str)   {    string entity = p->tag_name();    if (sizeof (entity) && entity[0] != '#')    return p->handle_var (entity,    p->html_context() == "splice_arg" ?    // No quoting of splice args. FIXME: Add    // some sort of safeguard against splicing    // in things like "nice><evil stuff='...'"?    RXML.t_text :    p->type); -  return p->type->free_text ? 0 : ({}); +  if (!p->type->free_text) +  RXML.parse_error ("Unknown entity &%s; not allowed in this context.\n", entity); +  return 0;   }