pike.git / lib / modules / Standards.pmod / URI.pike

version» Context lines:

pike.git/lib/modules/Standards.pmod/URI.pike:1:   #pike __REAL_VERSION__      //! This class implements URI parsing and resolving of relative references to   //! absolute form, as defined in RFC 2396 and RFC 3986.      // Implemented by Johan Sundström and Johan Schön. - // $Id: URI.pike,v 1.30 2009/07/21 09:03:58 mast Exp $ + // $Id: URI.pike,v 1.31 2009/08/15 07:21:46 nilsson Exp $      #pragma strict_types      //! Scheme component of URI   string scheme;      //! Authority component of URI (formerly called net_loc, from RFC 2396   //! known as authority)   string authority;   
pike.git/lib/modules/Standards.pmod/URI.pike:411:   }      //! Returns path and query part of the URI if present.   string get_path_query()   {    return (path||"") + (query ? "?" + query : "");   }      //! Returns the query variables as a @expr{mapping(string:string)@}.   mapping(string:string) get_query_variables() { -  return (mapping(string:string))(((query||"")/"&")[*]/"="); +  if(!query) return ([]); +  return (mapping(string:string))((query/"&")[*]/"=");   }      //! Sets the query variables from the provided mapping.   void set_query_variables(mapping(string:string) vars) {    if(!sizeof(vars))    query = 0;    else    query = ((array)vars)[*]*"="*"&";   }