Roxen.git/
server/
modules/
misc/
pathinfo.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2015-10-23
2015-10-23 13:54:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>
84aee5be36612de01de322be97ccf4ab5ee8c06b (
6
lines) (+
4
/-
2
)
[
Show
|
Annotate
]
Branch:
6983e3e3128b93948cdd93fe9bc273ff8cac3e63
Merge commit '8a2ce4a87' into patches/bug7582
* commit '8a2ce4a87': (7413 commits)
1:
-
// This is a roxen module. Copyright © 1998 -
2000
, Roxen IS.
+
// This is a roxen module. Copyright © 1998 -
2009
, Roxen IS.
-
+
#include <module.h>
inherit "module";
-
constant cvs_version = "
$Id: pathinfo.pike,v 1.16 2001/05/16 07:51:00 per Exp $
";
+
constant cvs_version = "
$Id$
";
constant thread_safe = 1; #ifdef PATHINFO_DEBUG
22:
/* #define PATHINFO_LINEAR */
+
array pathlimit = ({ });
+
+
void create(Configuration c) {
+
defvar("pathlimit", ({ }), "Limit to paths",
+
TYPE_STRING_LIST,
+
"If specified, path info support will only be active for paths matching globs provided in this list.");
+
}
+
+
void start() {
+
pathlimit = query("pathlimit");
+
}
+
mapping|int last_resort(object id) {
-
+
if(sizeof(pathlimit)) {
+
int found_match = 0;
+
foreach(pathlimit, string s) {
+
if(glob(s, id->not_query)) {
+
found_match = 1;
+
break;
+
}
+
}
+
if(!found_match)
+
return 0;
+
}
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