fix: Pluggable URL handlers didn't work with gateways other than /.

This commit is contained in:
JT Smith 2008-01-29 22:21:51 +00:00
parent bff94329dc
commit 215914590a
3 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,7 @@
7.5.1
- rfe: maintenance - turn on/off maintenance mode from the command line
- Slight performance increase in asset queries.
- fix: Pluggable URL handlers didn't work with gateways other than /.
- fix: RSS missing in message (perlDreamer Consulting, LLC.)
http://www.plainblack.com/bugs/tracker/rss-missing-in-message
- fix: Friends language error (perlDreamer Consulting, LLC.)

View file

@ -458,7 +458,7 @@
# { "^/perl-status$" : "WebGUI::URL::PassThru" },
{ "^/uploads/dictionaries" : "WebGUI::URL::Unauthorized" },
{ "^/uploads" : "WebGUI::URL::Uploads" },
{ "^/\*give-credit-where-credit-is-due\*$" : "WebGUI::URL::Credits" },
{ "^/\\*give-credit-where-credit-is-due\\*$" : "WebGUI::URL::Credits" },
{ "^/abcdefghijklmnopqrstuvwxyz$" : "WebGUI::URL::Snoop" },
{ ".*" : "WebGUI::URL::Content" }
],

View file

@ -63,9 +63,14 @@ sub handler {
my $server = Apache2::ServerUtil->server; #instantiate the server api
my $config = WebGUI::Config->new($server->dir_config('WebguiRoot'), $configFile); #instantiate the config object
my $error = "";
my $matchUri = $request->uri;
my $gateway = $config->get("gateway");
warn $matchUri;
$matchUri =~ s{^$gateway(.*)}{/$1};
warn $matchUri;
foreach my $handler (@{$config->get("urlHandlers")}) {
my ($regex) = keys %{$handler};
if ($request->uri =~ m{$regex}i) {
if ($matchUri =~ m{$regex}i) {
my $output = eval { WebGUI::Pluggable::run($handler->{$regex}, "handler", [$request, $server, $config]) };
if ($@) {
die $@ if ($@ =~ "^fatal:");