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.29 2008/06/28 16:49:56 nilsson Exp $ + // $Id: URI.pike,v 1.30 2009/07/21 09:03:58 mast 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:188:    // RFC 2396, §5.2:    // 1) The URI reference is parsed into the potential four components and    // fragment identifier, as described in Section 4.3.       // 2) If the path component is empty and the scheme, authority, and    // query components are undefined, then it is a reference to the    // current document and we are done. Otherwise, the reference URI's    // query and fragment components are defined as found (or not found)    // within the URI reference and not inherited from the base URI.    // (Doing this at once saves us some useless parsing efforts.) -  if(!uri || uri == "") +  if((!uri || uri == "") && this_program::base_uri)    {    DEBUG("Path is empty -- Inherit entire base URI "    "as per RFC 2396, §5.2 step 2. Done!");    inherit_properties(this_program::base_uri);    return;    }    -  if(uri[0] == '#') +  if(has_prefix (uri, "#") && this_program::base_uri)    {    DEBUG("Fragment only. Using entire base URI, except fragment.");    inherit_properties(this_program::base_uri);    fragment = uri[1..];    return;    }       // Parse fragment identifier    sscanf(uri, "%s#%s", uri, fragment);    DEBUG("Found fragment %O", fragment);