Make makeUrlCompliant as deprecated, and updated POD and subroutines accordingly.
This commit is contained in:
parent
1aaac5fbfb
commit
944c76040a
5 changed files with 5 additions and 17 deletions
|
|
@ -4,6 +4,7 @@
|
|||
- fixed #12102: User profiling field extras information
|
||||
- fixed #12106: CalendarUpdateFeeds activity does not handle time zones correctly
|
||||
- fixed #11213: Gooey on the Go format problem
|
||||
- mark makeUrlCompliant as deprecated.
|
||||
|
||||
7.10.14
|
||||
- fixed #12094: Cannot enter in Macros in URLs inside TinyMCE.
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ This package provides an interface to the internationalization system.
|
|||
$string = $i->get($internationalId);
|
||||
$string = $i->get($internationalId, $otherNamespace);
|
||||
|
||||
$url = $i->makeUrlCompliant($url);
|
||||
|
||||
$hashRef = $i->getLanguage($lang);
|
||||
|
||||
$hashRef = $i->getLanguages();
|
||||
|
|
@ -218,6 +216,8 @@ sub getLanguages {
|
|||
|
||||
=head2 makeUrlCompliant ( url [ , language ] )
|
||||
|
||||
THIS METHOD IS DEPRECATED AND WILL BE REMOVED FROM WEBGUI.
|
||||
|
||||
Manipulates a URL to make sure it will work on the internet. It removes things like non-latin characters, etc.
|
||||
|
||||
=head3 url
|
||||
|
|
@ -232,11 +232,7 @@ Specify a default language. Defaults to user preference or "English".
|
|||
|
||||
sub makeUrlCompliant {
|
||||
my ($self, $url, $language) = @_;
|
||||
$language = $language || $self->{_language} || $self->session->user->profileField("language") || "English";
|
||||
my $cmd = "WebGUI::i18n::".$language;
|
||||
WebGUI::Pluggable::load($cmd);
|
||||
my $output = WebGUI::Pluggable::run($cmd, 'makeUrlCompliant', [$url]);
|
||||
return $output;
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ sub makeAbsolute {
|
|||
|
||||
=head2 makeCompliant ( string )
|
||||
|
||||
Returns a string that has made into a WebGUI compliant URL based upon the language being submitted.
|
||||
Returns a string that has been made into a WebGUI compliant URL.
|
||||
|
||||
=head3 string
|
||||
|
||||
|
|
|
|||
|
|
@ -1024,7 +1024,6 @@ Couldn't open %-s because %-s <br />
|
|||
<dd>The new URL will be based on the Asset's present URL.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<p>New URLs will be passed through the makeUrlCompliant function that is specific to the default language for your site.</p>
|
||||
|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,14 +12,6 @@ our $LANGUAGE = {
|
|||
|
||||
sub makeUrlCompliant { # you have to have this method, but it can do URL transcoding for your language
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue