]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/git.pm
another useless use of scalar
[git.ikiwiki.info.git] / IkiWiki / Plugin / git.pm
index 6a7f6c3ae3f9eaf3e5dafab166fa3060d946cdf0..042c69f5a043699ff275f4acb7433a9482a366c8 100644 (file)
@@ -94,8 +94,8 @@ sub getsetup () {
                },
                diffurl => {
                        type => "string",
-                       example => "http://git.example.com/gitweb.cgi?p=wiki.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]",
-                       description => "gitweb url to show a diff ([[sha1_to]], [[sha1_from]], [[sha1_parent]], [[sha1_commit]] and [[file]] substituted)",
+                       example => "http://git.example.com/gitweb.cgi?p=wiki.git;a=blobdiff;f=[[file]];h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_commit]];hpb=[[sha1_parent]]",
+                       description => "gitweb url to show a diff ([[file]], [[sha1_to]], [[sha1_from]], [[sha1_commit]], and [[sha1_parent]] substituted)",
                        safe => 1,
                        rebuild => 1,
                },
@@ -139,6 +139,12 @@ sub safe_git (&@) {
        my @lines;
        while (<$OUT>) {
                chomp;
+               
+               # check for invalid utf-8, and toss it back to avoid crashes
+               if (! utf8::valid($_)) {
+                       $_=encode_utf8($_);
+               }
+
                push @lines, $_;
        }