Roxen.git/
server/
modules/
misc/
pathinfo.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2007-05-16
2007-05-16 15:23:41 by Stefan Wallström <stewa@roxen.com>
980d5313ad6f80a86a99eac97e156cfd81d18d1a (
27
lines) (+
26
/-
1
)
[
Show
|
Annotate
]
Branch:
5.2
Path limit option
Rev: server/modules/misc/pathinfo.pike:1.20
1:
// This is a roxen module. Copyright © 1998 - 2004, Roxen IS.
+
#include <module.h>
inherit "module";
-
constant cvs_version = "$Id: pathinfo.pike,v 1.
19
2004
/
06
/
30
16:
59
:
16
mast
Exp $";
+
constant cvs_version = "$Id: pathinfo.pike,v 1.
20
2007
/
05
/
16
15
:
23
:
41
stewa
Exp $";
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 patsh 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