aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2013-07-17 16:49:46 -0400
committerAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2013-07-17 16:49:46 -0400
commit5c0a18e75a5bf9d6ce9da3a1a525117fe9ee8e47 (patch)
tree9d0f5e33e2eb93dbda3f22d92af4e04e55c2ea84 /IkiWiki/Plugin
parent83e5069aab99dfec9d0ee581b3d68583f5b14834 (diff)
parentac386bc7b69a8bf946918c0b46533975d249cf97 (diff)
downloadikiwiki-5c0a18e75a5bf9d6ce9da3a1a525117fe9ee8e47.tar
ikiwiki-5c0a18e75a5bf9d6ce9da3a1a525117fe9ee8e47.tar.gz
Merge branch 'master' into fancypodcast
Conflicts: doc/todo/fancypodcast.mdwn
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/attachment.pm12
-rw-r--r--IkiWiki/Plugin/git.pm8
-rw-r--r--IkiWiki/Plugin/openid.pm15
3 files changed, 25 insertions, 10 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index aea70429d..83dd120f6 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -274,15 +274,15 @@ sub attachments_save {
foreach my $filename (glob("$dir/*")) {
$filename=Encode::decode_utf8($filename);
next unless -f $filename;
- my $destdir=$config{srcdir}."/".
- linkpage(IkiWiki::possibly_foolish_untaint(
- attachment_location($form->field('page'))));
+ my $destdir=linkpage(IkiWiki::possibly_foolish_untaint(
+ attachment_location($form->field('page'))));
+ my $absdestdir=$config{srcdir}."/".$destdir;
my $destfile=IkiWiki::basename($filename);
- my $dest=$destdir.$destfile;
+ my $dest=$absdestdir.$destfile;
unlink($dest);
- IkiWiki::prep_writefile($destfile, $destdir);
+ IkiWiki::prep_writefile($destfile, $absdestdir);
rename($filename, $dest);
- push @attachments, $dest;
+ push @attachments, $destdir.$destfile;
}
return unless @attachments;
require IkiWiki::Render;
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 3879abeae..bbdcbdba8 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -550,7 +550,13 @@ sub rcs_commit_helper (@) {
# Force git to allow empty commit messages.
# (If this version of git supports it.)
my ($version)=`git --version` =~ /git version (.*)/;
- if ($version ge "1.5.4") {
+ if ($version ge "1.7.8") {
+ push @opts, "--allow-empty-message", "--no-edit";
+ }
+ if ($version ge "1.7.2") {
+ push @opts, "--allow-empty-message";
+ }
+ elsif ($version ge "1.5.4") {
push @opts, '--cleanup=verbatim';
}
else {
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index 40a956849..e3b9982f2 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -156,8 +156,8 @@ sub validate ($$$;$) {
$trust_root=$cgiurl if ! defined $trust_root;
my $check_url = $claimed_identity->check_url(
- return_to => "$cgiurl?do=postsignin",
- trust_root => $trust_root,
+ return_to => auto_upgrade_https($q, "$cgiurl?do=postsignin"),
+ trust_root => auto_upgrade_https($q, $trust_root),
delayed_return => 1,
);
# Redirect the user to the OpenID server, which will
@@ -258,10 +258,19 @@ sub getobj ($$) {
ua => $ua,
args => $q,
consumer_secret => sub { return shift()+$secret },
- required_root => $cgiurl,
+ required_root => auto_upgrade_https($q, $cgiurl),
);
}
+sub auto_upgrade_https {
+ my $q=shift;
+ my $url=shift;
+ if ($q->https()) {
+ $url=~s/^http:/https:/i;
+ }
+ return $url;
+}
+
sub load_openid_module {
# Give up if module is unavailable to avoid needing to depend on it.
eval q{use Net::OpenID::Consumer};