summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2011-04-17 22:17:52 +0200
committerJonas Smedegaard <dr@jones.dk>2013-10-13 00:52:57 +0200
commit81a0e4d074b178fdc513b51ebd9196b53d85a5d6 (patch)
tree6ffdeb3c31d47a8245600b8b9ff8b38e5923ae4f /IkiWiki
parentb6f9bc3f05a2879a3632df226340646cd5f75ee4 (diff)
Permit unsafe JavaScript handling in meta.pm.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/meta.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index e7b96bd..ebbf4d7 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -194,11 +194,12 @@ sub preprocess (@) {
elsif ($key eq 'script') {
my $defer=exists $params{defer} ? ' defer="defer"' : '';
my $async=exists $params{async} ? ' async="async"' : '';
+ my $srcurl=$value;
my $js=bestlink($page, $value.".js");
- if (! length $js) {
- error gettext("script not found");
+ if (length $js) {
+ $srcurl=urlto($js, $page);
}
- push @{$metaheaders{$page}}, scrub('<script src="'.urlto($js, $page).
+ push @{$metaheaders{$page}}, scrub('<script src="'. $srcurl .
'"' . $defer . $async . ' type="text/javascript"></script>',
$page, $destpage);
}