my $page=shift;
my $pagespec=shift;
+ my $simple=$pagespec =~ /$config{wiki_file_regexp}/ &&
+ $pagespec !~ /[\s*?()!]/;
+
my $deptype=$DEPEND_CONTENT | $DEPEND_EXISTS;
if (@_) {
my %params=@_;
- if (defined $params{content} && $params{content} == 0) {
+ if (defined $params{content} && $params{content} == 0 &&
+ ($simple || pagespec_contentless($pagespec))) {
$deptype=$deptype & ~$DEPEND_CONTENT;
}
}
- if ($pagespec =~ /$config{wiki_file_regexp}/ &&
- $pagespec !~ /[\s*?()!]/) {
- # a simple dependency, which can be matched by string eq
+ if ($simple) {
$depends_simple{$page}{lc $pagespec} |= $deptype;
return 1;
}
return ! $@;
}
+sub pagespec_contentless ($) {
+ my $spec=shift;
+
+ while ($spec=~m{
+ (\w+)\([^\)]*\) # only match pagespec functions
+ }igx) {
+ return 0 unless $1=~/^(glob|internal|creation_month|creation_day|creation_year|created_before|created_after)$/;
+ }
+
+ return 1;
+}
+
sub glob2re ($) {
my $re=quotemeta(shift);
$re=~s/\\\*/.*/g;