Branch: Tag:

2012-03-09

2012-03-09 14:46:24 by Martin Nilsson <nilsson@opera.com>

Fixes to get_http_path_query()

525:    return replace(in, [array(string)]url_from, [array(string)]url_to);   }    - //! Return the query part, coded according to RFC 1738. + //! Return the query part, coded according to RFC 1738, or zero.   string get_http_query() { -  mapping(string:string) out = ([]); -  foreach(get_query_variables(); string name; string value) -  out[http_encode(name)] = http_encode(value); -  return ((array)out)[*]*"="*"&"; +  return query;   }      //! Return the path and query part of the URI, coded according to RFC   //! 1738.   string get_http_path_query() { -  return http_encode(((path||"")/"/")[*])*"/" + -  (query?"?"+get_http_query():""); +  string q = get_http_query(); +  return http_encode(((path||"")/"/")[*])*"/" + (q?"?"+q:"");   }