Fix problem with asset export not handling certain URLs with dots in them correctly.

This commit is contained in:
Drake 2006-10-12 00:05:06 +00:00
parent a4784a31e9
commit f7a61cd5c6
2 changed files with 17 additions and 12 deletions

View file

@ -1,3 +1,6 @@
7.1.1
- fix: some issues with asset exports not handling URLs with dots correctly
7.1.0
- fix: mysql and mysqldump were transposed in upgrade.pl --help
- fix: adding Matrix listings committing the current version tag

View file

@ -108,25 +108,27 @@ sub _exportAsHtml {
my $filename;
if ($url =~ /\./) {
$url =~ /^(.*)\/(.*)$/;
$path = $1;
$filename = $2;
if ($filename eq "") {
$filename = $path;
if ($url =~ /^(.*)\/(.*)$/) {
$path = $1;
$filename = $2;
if ($filename eq "") {
$filename = $path;
$path = undef;
}
} else {
$path = undef;
$filename = $url;
}
} else {
$path = $url;
$filename = $index;
}
if ($path) {
$path = $self->session->config->get("exportPath") . "/" . $path;
eval { mkpath($path) };
if($@) {
return (0, sprintf($i18n->get('could not create path'), $path, $@));
}
}
$path = $self->session->config->get("exportPath") . (length($path)? "/$path" : "");
eval { mkpath($path) };
if($@) {
return (0, sprintf($i18n->get('could not create path'), $path, $@));
}
$path .= "/".$filename;
my $file = eval { FileHandle->new(">".$path) or die "$!" };