summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/meta.pm20
-rw-r--r--IkiWiki/Plugin/osm.pm2
2 files changed, 19 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index ea099f9..cd367da 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -155,14 +155,30 @@ sub preprocess (@) {
eval q{use Date::Parse};
if (! $@) {
my $time = str2time($value);
- $IkiWiki::pagectime{$page}=$time if defined $time;
+ if (defined $time) {
+ $IkiWiki::pagectime{$page}=$time;
+ }
+ else {
+ error(sprintf(gettext('cannot parse date/time: %s'), $value));
+ }
+ }
+ else {
+ error $@;
}
}
elsif ($key eq 'updated') {
eval q{use Date::Parse};
if (! $@) {
my $time = str2time($value);
- $pagestate{$page}{meta}{updated}=$time if defined $time;
+ if (defined $time) {
+ $pagestate{$page}{meta}{updated}=$time;
+ }
+ else {
+ error(sprintf(gettext('cannot parse date/time: %s'), $value));
+ }
+ }
+ else {
+ error $@;
}
}
diff --git a/IkiWiki/Plugin/osm.pm b/IkiWiki/Plugin/osm.pm
index a5af4ed..27db31a 100644
--- a/IkiWiki/Plugin/osm.pm
+++ b/IkiWiki/Plugin/osm.pm
@@ -233,7 +233,7 @@ sub get_tag_icon($) {
my $tag = shift;
# look for an icon attached to the tag
my $attached = $tag . '/' . $config{'osm_tag_default_icon'};
- if (srcfile($attached)) {
+ if (srcfile($attached, 1)) {
return $attached;
}
else {