Fixes bug #11780: anchor filename regex to the end of the string.
This commit is contained in:
parent
05c287cfc7
commit
8f7bbdaa5d
3 changed files with 13 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
7.9.13
|
7.9.13
|
||||||
- fixed #11783: Instances deleted during realtime run
|
- fixed #11783: Instances deleted during realtime run
|
||||||
- fixed #11781: Thingy wrong retorn value from Ajax method
|
- fixed #11781: Thingy wrong retorn value from Ajax method
|
||||||
|
- fixed #11780: fixFilenames regex needs an anchor in ZipArchive asset
|
||||||
|
|
||||||
7.9.12
|
7.9.12
|
||||||
- webgui.org homepage gives 404 (#11778)
|
- webgui.org homepage gives 404 (#11778)
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,8 @@ sub fixFilenames {
|
||||||
my $extension = $storage->getFileExtension($file);
|
my $extension = $storage->getFileExtension($file);
|
||||||
next FILE unless isIn($extension, qw/pl perl pm cgi php asp sh/);
|
next FILE unless isIn($extension, qw/pl perl pm cgi php asp sh/);
|
||||||
my $newFile = $file;
|
my $newFile = $file;
|
||||||
$newFile =~ s/\.$extension/_$extension.txt/;
|
#$newFile =~ s/\.$extension$/_$extension.txt/;
|
||||||
|
$newFile =~ s/\.$extension$/_$extension.txt/;
|
||||||
$storage->renameFile($file, $newFile);
|
$storage->renameFile($file, $newFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ use WebGUI::Asset::File::ZipArchive;
|
||||||
use WebGUI::Test;
|
use WebGUI::Test;
|
||||||
use Test::More; # increment this value for each test you create
|
use Test::More; # increment this value for each test you create
|
||||||
use Test::Deep;
|
use Test::Deep;
|
||||||
plan tests => 2;
|
plan tests => 3;
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -42,3 +42,12 @@ cmp_bag(
|
||||||
[ qw{ extensions.tar extension_pm.txt extension_perl.txt extension.html extensions extensions/extension.html }],
|
[ qw{ extensions.tar extension_pm.txt extension_perl.txt extension.html extensions extensions/extension.html }],
|
||||||
'files after fixFilenames, html files left alone'
|
'files after fixFilenames, html files left alone'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$storage->addFileFromScalar('file.pm.pm','content');
|
||||||
|
$arch->fixFilenames();
|
||||||
|
|
||||||
|
cmp_bag(
|
||||||
|
$storage->getFiles,
|
||||||
|
[ qw{ extensions.tar extension_pm.txt extension_perl.txt extension.html extensions extensions/extension.html file_pm.pm.txt}],
|
||||||
|
'fixFilenames: anchors replacements to the end of the string'
|
||||||
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue