Attachments are no longer lowercased like all other URLs.
This commit is contained in:
parent
3b8e6be358
commit
45e9b73e83
2 changed files with 14 additions and 6 deletions
|
|
@ -428,7 +428,7 @@ sub save {
|
||||||
$_[0]->{_filename} =~ s/\./\_/g;
|
$_[0]->{_filename} =~ s/\./\_/g;
|
||||||
$_[0]->{_filename} .= ".txt";
|
$_[0]->{_filename} .= ".txt";
|
||||||
}
|
}
|
||||||
$_[0]->{_filename} = WebGUI::URL::urlize($_[0]->getFilename);
|
$_[0]->{_filename} = WebGUI::URL::makeCompliant($_[0]->getFilename);
|
||||||
$_[0]->{_node}->create();
|
$_[0]->{_node}->create();
|
||||||
$file = FileHandle->new(">".$_[0]->getPath);
|
$file = FileHandle->new(">".$_[0]->getPath);
|
||||||
if (defined $file) {
|
if (defined $file) {
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,18 @@ sub gateway {
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
sub makeCompliant {
|
||||||
|
my ($value);
|
||||||
|
$value = $_[0];
|
||||||
|
$value =~ s/\s+$//g; #removes trailing whitespace
|
||||||
|
$value =~ s/^\s+//g; #removes leading whitespace
|
||||||
|
$value =~ s/ /_/g; #replaces whitespace with underscores
|
||||||
|
$value =~ s/\.$//g; #removes trailing period
|
||||||
|
$value =~ s/[^A-Za-z0-9\-\.\_]//g; #removes all funky characters
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub makeUnique {
|
sub makeUnique {
|
||||||
my ($url, $test, $pageId);
|
my ($url, $test, $pageId);
|
||||||
|
|
@ -83,11 +95,7 @@ sub unescape {
|
||||||
sub urlize {
|
sub urlize {
|
||||||
my ($value);
|
my ($value);
|
||||||
$value = lc($_[0]); #lower cases whole string
|
$value = lc($_[0]); #lower cases whole string
|
||||||
$value =~ s/\W+$//g; #removes trailing whitespace
|
$value = makeCompliant($value);
|
||||||
$value =~ s/^\W+//g; #removes leading whitespace
|
|
||||||
$value =~ s/ /_/g; #replaces whitespace with underscores
|
|
||||||
$value =~ s/\.$//g; #removes trailing period
|
|
||||||
$value =~ s/[^a-z0-9\-\.\_]//g; #removes all funky characters
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue