Branch: Tag:

2009-08-15

2009-08-15 07:21:46 by Martin Nilsson <mani@lysator.liu.se>

Fixed backtrace when calling get_query_variables() on URI without query variables

Rev: lib/modules/Standards.pmod/URI.pike:1.31
Rev: lib/modules/Standards.pmod/testsuite.in:1.18

4:   //! 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   
418:      //! 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.