From 22901a0318e8b1f71fd524016b126952b43f63c3 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sat, 17 May 2003 00:31:46 +0000 Subject: [PATCH] fixed a potential problem where adding a slash at the end of a url would cause the user to only see the not found page. --- lib/WebGUI/Session.pm | 2 +- lib/WebGUI/URL.pm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Session.pm b/lib/WebGUI/Session.pm index 5c97845b7..36a972671 100644 --- a/lib/WebGUI/Session.pm +++ b/lib/WebGUI/Session.pm @@ -75,7 +75,7 @@ sub _setupPageInfo { ($pageId) = $_[0]; if ($pageId eq "") { $pageName = lc($ENV{PATH_INFO}); - #$pageName =~ s/\///g; + $pageName =~ s/\/$//; $pageName =~ s/\///; $pageName =~ s/\'//; $pageName =~ s/\"//; diff --git a/lib/WebGUI/URL.pm b/lib/WebGUI/URL.pm index a52f140fa..17776912b 100644 --- a/lib/WebGUI/URL.pm +++ b/lib/WebGUI/URL.pm @@ -234,7 +234,7 @@ sub unescape { =head2 urlize ( string ) -Same as makeCompliant except that it also lower-cases the string. This is mainly meant for WebGUI page URLs. +Returns a url that is safe for WebGUI pages. =over @@ -250,6 +250,7 @@ sub urlize { my ($value); $value = lc($_[0]); #lower cases whole string $value = makeCompliant($value); + $value =~ s/\/$//; return $value; }