aboutsummaryrefslogtreecommitdiff
path: root/t/pagespec_match.t
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-05-18 15:25:10 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-05-18 15:25:10 -0400
commit23a4ee6d15dbd9b8e8c6588a829dd30a26a8de32 (patch)
tree5d7d76ba25bd6331e1f2940c481477ecb4de9d12 /t/pagespec_match.t
parent0516ba04d014628be983dbd3e4c28a8f52a2c3e7 (diff)
downloadikiwiki-23a4ee6d15dbd9b8e8c6588a829dd30a26a8de32.tar
ikiwiki-23a4ee6d15dbd9b8e8c6588a829dd30a26a8de32.tar.gz
Allow curly braces to be used in pagespecs
And avoid a whole class of potential security problems (though none that I know of actually existing..), by avoiding performing any string interpolation on user-supplied data when translating pagespecs.
Diffstat (limited to 't/pagespec_match.t')
-rwxr-xr-xt/pagespec_match.t4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/pagespec_match.t b/t/pagespec_match.t
index 69cf361de..4cf6fa1ff 100755
--- a/t/pagespec_match.t
+++ b/t/pagespec_match.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 51;
+use Test::More tests => 53;
BEGIN { use_ok("IkiWiki"); }
@@ -28,6 +28,8 @@ ok(pagespec_match("a/foo", "./*", "a/b"), "relative oldstyle call");
ok(pagespec_match("foo", "./*", location => "a"), "relative toplevel");
ok(pagespec_match("foo/bar", "*", location => "baz"), "absolute");
ok(! pagespec_match("foo", "foo and bar"), "foo and bar");
+ok(pagespec_match("{f}oo", "{*}*"), "curly match");
+ok(! pagespec_match("foo", "{*}*"), "curly !match");
# The link and backlink stuff needs this.
$config{userdir}="";