]> git.sur5r.net Git - bacula/bacula/commitdiff
bweb: escape _ % for LIKE search
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 10 Nov 2009 14:08:57 +0000 (15:08 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 10 Nov 2009 14:08:57 +0000 (15:08 +0100)
gui/bweb/cgi/bresto.pl

index 662504f32c75e470f17d1115d139dd1611cdd9c2..9442a552cb1a4ff0791b3c1ec2cea407c9e8b5d7 100755 (executable)
@@ -914,6 +914,7 @@ sub fill_table_for_restore
 
     foreach my $dirid (@dirid) {
         my $p = $bvfs->get_path($dirid);
+        $p =~ s/([%_\\])/\\$1/g;  # Escape % and _ for LIKE search
         $p = $bvfs->dbh_quote($p);
         push @union, "
   (SELECT File.JobId, File.FileIndex, File.FilenameId, File.PathId $FileId