From f7a61cd5c66ad48a4d14cdca820adb53cdbbc5c6 Mon Sep 17 00:00:00 2001 From: Drake Date: Thu, 12 Oct 2006 00:05:06 +0000 Subject: [PATCH] Fix problem with asset export not handling certain URLs with dots in them correctly. --- docs/changelog/7.x.x.txt | 3 +++ lib/WebGUI/AssetExportHtml.pm | 26 ++++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 249def051..01bef3e53 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -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 diff --git a/lib/WebGUI/AssetExportHtml.pm b/lib/WebGUI/AssetExportHtml.pm index ee2a645b4..aead4f49a 100644 --- a/lib/WebGUI/AssetExportHtml.pm +++ b/lib/WebGUI/AssetExportHtml.pm @@ -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 "$!" };