Branch: Tag:

2000-03-20

2000-03-20 03:05:56 by Martin Stjernholm <mast@lysator.liu.se>

Fixed bug that reversed the last part of the path_info path(!). Added
more descriptive module doc.

Rev: server/modules/misc/pathinfo.pike:1.12

2:      inherit "module";    - constant cvs_version = "$Id: pathinfo.pike,v 1.11 2000/03/16 18:57:14 nilsson Exp $"; + constant cvs_version = "$Id: pathinfo.pike,v 1.12 2000/03/20 03:05:56 mast Exp $";   constant thread_safe = 1;      #ifdef PATHINFO_DEBUG
12:   #endif      constant module_type = MODULE_LAST; - constant module_name = "PATH_INFO support"; - constant module_doc = "Support for PATH_INFO style URLs."; + constant module_name = "Path info support"; + constant module_doc = #"\ + Support for \"path info\" style URLs, e.g. URLs that got a path like + <tt>/index.html/a/b</tt>, where <tt>/index.html</tt> is an existing + file, but <tt>/index.html/a</tt> and <tt>/index.html/a/b</tt> aren't. + In this case <tt>/index.html</tt> will be fetched, and the rest, + <tt>/a/b</tt> is made available in the RXML variable page.pathinfo.";      mapping|int last_resort(object id)   {
32:    string add_path_info;    sscanf( query, "%[^/]/%s", add_path_info, query );    query = reverse( query ); -  if( strlen( pi ) ) +     pi = "/"+reverse( add_path_info )+pi; -  else -  pi = "/"+add_path_info; +     id->misc->path_info = pi;    PATHINFO_WERR(sprintf("Trying: %O (%O)", query, pi));    array st = id->conf->stat_file( query, id );