From 39f1a3da3cf9d443bd7e81f93b58615b6cde0e72 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 14 Feb 2008 23:51:17 +0000 Subject: [PATCH] forward port slash handling fix from 7.4 branch --- docs/changelog/7.x.x.txt | 11 +++++++++++ lib/WebGUI/Session/Url.pm | 2 +- t/Session/Url.t | 10 ++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8b1867af7..df76ebd78 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -13,6 +13,17 @@ a url to search the gallery for the keyword. - add: Photos now track views - fix: Multiple Gallery template fixes. + +7.4.24 + - fix: https and extra / in urls (perlDreamer Consulting, LLC.) + http://www.webgui.org/bugs/tracker/https-and-extra-/-in-urls + +7.4.23 + - fix: CalendarUpdateFeeds workflow causes errors in log + - autocommit for packages is handled by web method, not API method + - fix: importing packages generates orphaned duplicates of all attached storage locations + - fix: error rolling back version tags if a parent has a later revision date than its child + - show fields in tabs on DataForm default email template - fix: don't show Admin mode toggle when not in adminModeSubnets - fix regression: Site starter style displays incorrectly in IE - really show fields in tabs on DataForm default email template diff --git a/lib/WebGUI/Session/Url.pm b/lib/WebGUI/Session/Url.pm index d0cf3c505..5ac3aefec 100644 --- a/lib/WebGUI/Session/Url.pm +++ b/lib/WebGUI/Session/Url.pm @@ -140,7 +140,7 @@ sub extras { my $self = shift; my $path = shift; my $url = $self->session->config->get("extrasURL").'/'.$path; - $url =~ s$(? 58 + scalar(@getRefererUrlTests); +plan tests => 60 + scalar(@getRefererUrlTests); my $session = WebGUI::Test->session; @@ -289,7 +289,13 @@ is($session->url->extras('/dir1//foo.html'), join('/', $extras,'dir1/foo.html'), $extras = 'http://mydomain.com/'; $session->config->set('extrasURL', $extras); -is($session->url->extras('/foo.html'), join('', $extras,'foo.html'), 'extras method removes extra slashes'); +is($session->url->extras('/foo.html'), join('', $extras,'foo.html'), 'extras method removes extra slashes'); +is($session->url->extras('/dir1//foo.html'), join('', $extras,'dir1/foo.html'), 'extras method removes extra slashes anywhere'); + +$extras = 'https://mydomain.com/'; +$session->config->set('extrasURL', $extras); + +is($session->url->extras('/foo.html'), join('', $extras,'foo.html'), 'extras method removes extra slashes'); is($session->url->extras('/dir1//foo.html'), join('', $extras,'dir1/foo.html'), 'extras method removes extra slashes anywhere'); $session->config->set('extrasURL', $origExtras);