Fix release notes typo
[koha.git] / edithelp.pl
index 28586b3..62b449f 100755 (executable)
@@ -65,7 +65,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 sub _get_filepath ($;$) {
     my $referer = shift;
     $referer =~ /koha\/(.*)\.pl/;
-    my $from = "help/$1.tt";
+    my $file = $1;
+    $file =~ s/[^0-9a-zA-Z_\-\/]*//g;
+    my $from = "help/$file.tt";
     my $htdocs = C4::Context->config('intrahtdocs');
     my ($theme, $lang, $availablethemes) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $input );
        $debug and print STDERR "help filepath: $htdocs/$theme/$lang/modules/$from";
@@ -96,7 +98,7 @@ elsif ( $type eq 'modify' ) {
                $error = "Cannot read file: '$file'.";
        } else {
                (-w $file) or $error = 
-                       "WARNING: You will not be able save, because your webserver cannot write to '$file'. Contact your admin about help file permissions.";
+                       "WARNING: You will not be able to save, because your webserver cannot write to '$file'. Contact your admin about help file permissions.";
        open (my $fh, '<', $file) or die "Cannot read file '$file'";            # unlikely death, since we just checked
                my $help = '';
         while ( <$fh> ) {