[Rt-commit] rt branch, 4.0/sanity-check-url-config, updated. rt-3.9.7-1128-gb95abf8
Shawn Moore
sartak at bestpractical.com
Tue Dec 28 19:03:47 EST 2010
The branch, 4.0/sanity-check-url-config has been updated
via b95abf852c1bd5cac77dc9d94faf16647f888e5f (commit)
from 71334f7afa6e98157f10e287669b5cd0d9a5bdf9 (commit)
Summary of changes:
lib/RT/Config.pm | 6 ++++++
t/api/web-config.t | 6 +++++-
2 files changed, 11 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit b95abf852c1bd5cac77dc9d94faf16647f888e5f
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Dec 28 19:03:36 2010 -0500
Catch Set($WebPath, '/') as a special case
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 4d5888e..265d706 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -544,6 +544,12 @@ our %META = (
# "In most cases, you should leave $WebPath set to '' (an empty value)."
return unless $value;
+ # try to catch someone who assumes that you shouldn't leave this empty
+ if ($value eq '/') {
+ $RT::Logger->error("For the WebPath config option, use the empty string instead of /");
+ return;
+ }
+
# $WebPath requires a leading / but no trailing /, or it can be blank.
return if $value =~ m{^/.+[^/]$};
diff --git a/t/api/web-config.t b/t/api/web-config.t
index 150784d..c91d1fa 100644
--- a/t/api/web-config.t
+++ b/t/api/web-config.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
use RT;
-use RT::Test nodb => 1, tests => 9;
+use RT::Test nodb => 1, tests => 11;
sub warnings_from {
my $option = shift;
@@ -34,3 +34,7 @@ is(@w, 2);
like($w[0], qr/The WebPath config option requires no trailing slash/);
like($w[1], qr/The WebPath config option requires a leading slash/);
+ at w = warnings_from(WebPath => '/');
+is(@w, 1);
+like($w[0], qr{For the WebPath config option, use the empty string instead of /});
+
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list