[Rt-commit] rt branch, 4.0/validate-webpath, created. rt-4.0.1rc1-37-gb818370

Shawn Moore sartak at bestpractical.com
Wed Jun 8 18:19:33 EDT 2011


The branch, 4.0/validate-webpath has been created
        at  b818370b262d60eb5a32c55e69110477f5d09068 (commit)

- Log -----------------------------------------------------------------
commit b818370b262d60eb5a32c55e69110477f5d09068
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Jun 8 18:07:49 2011 -0400

    When validating WebPath, use better PSGI variables
    
        PATH_INFO is everything after the WebPath. SCRIPT_NAME is supposed to
        match WebPath.

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 11ba877..b7f5140 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1100,8 +1100,8 @@ sub ValidateWebConfig {
         }
     }
 
-    if ($ENV{PATH_INFO} !~ /^\Q$RT::WebPath\E/) {
-        $RT::Logger->warn("A requested path ($ENV{PATH_INFO}) does NOT fall within the configured WebPath ($RT::WebPath). You should fix your Set(\$WebPath, ...) setting in RT_SiteConfig.pm otherwise your internal links may be broken.");
+    if ($ENV{SCRIPT_NAME} ne RT->Config->Get('WebPath')) {
+        $RT::Logger->warn("The actual SCRIPT_NAME ($ENV{SCIRPT_NAME}) does NOT match the configured WebPath ($RT::WebPath). Perhaps you should Set(\$WebPath, '$ENV{SCRIPT_NAME}') in RT_SiteConfig.pm, otherwise your internal links may be broken.");
     }
 }
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list