- URLs that would have been created like page.html/article.html are now
created like page/article.html to make them look more realistic.
This commit is contained in:
parent
f43fb782f4
commit
cc569b1b4d
2 changed files with 18 additions and 0 deletions
|
|
@ -12,6 +12,8 @@
|
||||||
- Fixed a problem with JSON formatting in spectre config transaction.
|
- Fixed a problem with JSON formatting in spectre config transaction.
|
||||||
- Changed Manage Revisions screen to order revisions by descending revision
|
- Changed Manage Revisions screen to order revisions by descending revision
|
||||||
date.
|
date.
|
||||||
|
- URLs that would have been created like page.html/article.html are now
|
||||||
|
created like page/article.html to make them look more realistic.
|
||||||
- fix: Fixing bad link on the Event page to the search engine. Added a new
|
- fix: Fixing bad link on the Event page to the search engine. Added a new
|
||||||
Event template variable called urlSearch to handle it. (perlDreamer Consulting, LLC)
|
Event template variable called urlSearch to handle it. (perlDreamer Consulting, LLC)
|
||||||
- fix: Set default groupIdEditEvent to groupIdEdit during upgrade (perlDreamer Consulting, LLC)
|
- fix: Set default groupIdEditEvent to groupIdEdit during upgrade (perlDreamer Consulting, LLC)
|
||||||
|
|
|
||||||
|
|
@ -385,12 +385,17 @@ Any text string. Most likely will have been the Asset's name or title.
|
||||||
sub fixUrl {
|
sub fixUrl {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $url = shift;
|
my $url = shift;
|
||||||
|
|
||||||
|
# build a URL from the parent
|
||||||
unless ($url) {
|
unless ($url) {
|
||||||
$url = $self->getParent->get("url");
|
$url = $self->getParent->get("url");
|
||||||
$url =~ s/(.*)\..*/$1/;
|
$url =~ s/(.*)\..*/$1/;
|
||||||
$url .= '/'.$self->getValue("menuTitle");
|
$url .= '/'.$self->getValue("menuTitle");
|
||||||
}
|
}
|
||||||
$url = $self->session->url->urlize($url);
|
$url = $self->session->url->urlize($url);
|
||||||
|
|
||||||
|
# fix urls used by uploads and extras
|
||||||
|
# and those beginning with http
|
||||||
my @badUrls = ($self->session->config->get("extrasURL"), $self->session->config->get("uploadsURL"));
|
my @badUrls = ($self->session->config->get("extrasURL"), $self->session->config->get("uploadsURL"));
|
||||||
foreach my $badUrl (@badUrls) {
|
foreach my $badUrl (@badUrls) {
|
||||||
if ($badUrl =~ /^http/) {
|
if ($badUrl =~ /^http/) {
|
||||||
|
|
@ -402,15 +407,26 @@ sub fixUrl {
|
||||||
$url = "_".$url;
|
$url = "_".$url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# urls can't be longer than 250 characters
|
||||||
if (length($url) > 250) {
|
if (length($url) > 250) {
|
||||||
$url = substr($url,220);
|
$url = substr($url,220);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# remove multiple extensions from the url if there are some
|
||||||
|
while ($url =~ m{^(.*)\.\w+(/.*)$}) {
|
||||||
|
$url =~ s{^(.*)\.\w+(/.*)$}{$1$2}ig;
|
||||||
|
}
|
||||||
|
|
||||||
|
# add automatic extension if we're supposed to
|
||||||
if ($self->session->setting->get("urlExtension") ne "" #don't add an extension if one isn't set
|
if ($self->session->setting->get("urlExtension") ne "" #don't add an extension if one isn't set
|
||||||
&& !($url =~ /\./) #don't add an extension of the url already contains a dot
|
&& !($url =~ /\./) #don't add an extension of the url already contains a dot
|
||||||
&& $self->get("url") eq $self->getId # only add it if we're creating a new url
|
&& $self->get("url") eq $self->getId # only add it if we're creating a new url
|
||||||
) {
|
) {
|
||||||
$url .= ".".$self->session->setting->get("urlExtension");
|
$url .= ".".$self->session->setting->get("urlExtension");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check to see if the url already exists or not, and increment it if it does
|
||||||
if ($self->urlExists($self->session, $url, {assetId=>$self->getId})) {
|
if ($self->urlExists($self->session, $url, {assetId=>$self->getId})) {
|
||||||
my @parts = split(/\./,$url);
|
my @parts = split(/\./,$url);
|
||||||
if ($parts[0] =~ /(.*)(\d+$)/) {
|
if ($parts[0] =~ /(.*)(\d+$)/) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue