From 07b4c390dd4d10750d694e40deb88d93a61fe968 Mon Sep 17 00:00:00 2001 From: gc Date: Tue, 29 Nov 2005 21:35:21 +0000 Subject: [PATCH] per suggestion of jl, test for bad chars before starting processing --- bin/booh-backend | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bin/booh-backend b/bin/booh-backend index 4c88919..db2d72f 100755 --- a/bin/booh-backend +++ b/bin/booh-backend @@ -609,16 +609,25 @@ def walk_source_dir end info("directories: #{examined_dirs.length}, sizes: #{$images_size.length}") + examined_dirs.each { |dir| + if dir =~ /'/ + die _("Source directory or sub-directories can't contain a single-quote character, sorry: %s") % dir + end + if $mode !~ /^use_config/ + Dir.entries(dir).each { |file| + if file =~ /['"\[\]]/ + die _("Files can't contain any of the characters ', \", [ or ], sorry: %s") % "#{dir}/#{file}" + end + } + end + } + examined_dirs.each { |dir| if File.basename(dir) =~ /^\./ msg 1, _("Ignoring directory %s, begins with a dot (indicating a hidden directory)") % dir next end - if dir =~ /'/ - die _("Source directory or sub-directories can't contain a single-quote character, sorry: %s") % dir - end - dest_dir = make_dest_filename(dir.sub(/^#{Regexp.quote($source)}/, $dest)) #- place xml document on proper node if exists, else create -- 2.30.4