Roxen.git
/
server
/
modules
/
misc
/
pathinfo.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/misc/pathinfo.pike:1:
// This is a roxen module. Copyright © 1998 - 2001, Roxen IS. inherit "module";
-
constant cvs_version = "$Id: pathinfo.pike,v 1.
17
2001
/
09
/
03
18
:
31
:
05
nilsson
Exp $";
+
constant cvs_version = "$Id: pathinfo.pike,v 1.
18
2004
/
04
/
19
16
:
45
:
47
mast
Exp $";
constant thread_safe = 1; #ifdef PATHINFO_DEBUG # define PATHINFO_WERR(X) werror("PATHINFO: "+X+"\n"); #else # define PATHINFO_WERR(X) #endif constant module_type = MODULE_LAST; constant module_name = "Scripting: Path info support";
Roxen.git/server/modules/misc/pathinfo.pike:18:
<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."; /* #define PATHINFO_LINEAR */ mapping|int last_resort(object id) { PATHINFO_WERR(sprintf("Checking %O...", id->not_query));
+
+
#if 0
+
// This kind of recursion detection doesn't work with internal
+
// redirects. We leave it to the generic loop prevention in
+
// handle_request et al.
if (id->misc->path_info) { // Already been here... PATHINFO_WERR(sprintf("Been here, done that.")); return 0; }
-
+
#endif
string query = id->not_query; #ifndef PATHINFO_LINEAR array(int) offsets = Array.map(query/"/", sizeof); int sum = 0; int i; for (i=0; i < sizeof(offsets); i++) { sum = (offsets[i] += sum) + 1; }