From febc052d9724292becf024ac0b3350adf17bc2e8 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 11 Apr 2007 02:50:14 +0000 Subject: [PATCH] add extra collateral for DateTime tests --- t/supporting_collateral/BadLocale.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 t/supporting_collateral/BadLocale.pm diff --git a/t/supporting_collateral/BadLocale.pm b/t/supporting_collateral/BadLocale.pm new file mode 100644 index 000000000..6792b97aa --- /dev/null +++ b/t/supporting_collateral/BadLocale.pm @@ -0,0 +1,25 @@ +package WebGUI::i18n::BadLocale; + +use strict; + + +our $LANGUAGE = { + label => 'BadLocale', + toolbar => 'bullet', +}; + +sub makeUrlCompliant { + my $value = shift; + $value =~ s/\s+$//; #removes trailing whitespace + $value =~ s/^\s+//; #removes leading whitespace + $value =~ s/ /-/g; #replaces whitespace with hyphens + $value =~ s/\.$//; #removes trailing period + $value =~ s/[^A-Za-z0-9\-\.\_\/]//g; #removes all funky characters + $value =~ s/^\///; #removes a leading / + $value =~ s/\/$//; #removes a trailing / + $value =~ s/\/\//\//g; #removes double / + return $value; +} + + +1;