OSDN Git Service

Plugin::Canonical: make path always ends with "/"
authorhylom <hylom@users.sourceforge.jp>
Tue, 2 Apr 2019 10:41:08 +0000 (19:41 +0900)
committerhylom <hylom@users.sourceforge.jp>
Tue, 2 Apr 2019 10:41:08 +0000 (19:41 +0900)
src/newslash_web/lib/Newslash/Plugin/Canonical.pm

index 36c9bb0..6bb5d34 100644 (file)
@@ -18,6 +18,9 @@ sub get_canonical_path {
             $path =~ s/\$1/$rep/;
         }
     }
+    if (substr($path, -1, 1) ne "/") {
+        $path = "$path/";
+    }
     return $path;
 }