From f7dc0a8604b2b658ced838e64fb9be80c4873fb5 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 2 Dec 2005 23:00:18 +0000 Subject: [PATCH] a couple of bug fixes --- docs/upgrades/upgrade_6.7.8-6.8.0.pl | 2 +- lib/WebGUI/URL.pm | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/docs/upgrades/upgrade_6.7.8-6.8.0.pl b/docs/upgrades/upgrade_6.7.8-6.8.0.pl index 4731557e0..1614337be 100644 --- a/docs/upgrades/upgrade_6.7.8-6.8.0.pl +++ b/docs/upgrades/upgrade_6.7.8-6.8.0.pl @@ -786,7 +786,7 @@ sub updateConfigFile { push(@{$newConfig{assets}}, "WebGUI::Asset::Wobject::StockData") unless isIn("WebGUI::Asset::Wobject::StockData",@{$newConfig{assets}}); push(@{$newConfig{assets}}, "WebGUI::Asset::Wobject::WeatherData") unless isIn("WebGUI::Asset::Wobject::WeatherData",@{$newConfig{assets}}); push(@{$newConfig{assets}}, "WebGUI::Asset::Wobject::MultiSearch") unless isIn("WebGUI::Asset::Wobject::MultiSearch",@{$newConfig{assets}}); - $newConfig{macros}{RandomThread}{RandomThread}; + $newConfig{macros}{RandomThread} = "RandomThread"; $newConfig{gateway} = "/"; $conf->purge; $conf->set(%newConfig); diff --git a/lib/WebGUI/URL.pm b/lib/WebGUI/URL.pm index 86d39e330..4c05e7d08 100644 --- a/lib/WebGUI/URL.pm +++ b/lib/WebGUI/URL.pm @@ -122,10 +122,8 @@ Name value pairs to add to the URL in the form of: sub gateway { my $pageUrl = shift; my $pairs = shift; - $pageUrl =~ s/^\///; - my $url = $session{config}{gateway}; - $url .= '/' unless ($url =~ m/\/$/); - $url .= $pageUrl; + my $url = $session{config}{gateway}.'/'.$pageUrl; + $url =~ s/\/+/\//g; if ($session{setting}{preventProxyCache} == 1) { $url = append($url,"noCache=".randint(0,1000).';'.time()); } @@ -246,12 +244,7 @@ sub page { if ($useFullUrl) { $url = getSiteURL(); } - $url .= gateway(); - if ($session{asset}) { - $url .= $session{asset}->get("url"); - } else { - $url .= $session{requestedUrl}; - } + $url .= gateway($session{asset} ? $session{asset}->get("url") : $session{requestedUrl}); if ($session{setting}{preventProxyCache} == 1 && !$skipPreventProxyCache) { $url = append($url,"noCache=".randint(0,1000).';'.time()); }