diff --git a/org/corfield/framework.cfc b/org/corfield/framework.cfc index 8fb53222..6280e192 100755 --- a/org/corfield/framework.cfc +++ b/org/corfield/framework.cfc @@ -1,7 +1,7 @@ component { - variables._fw1_version = "2.5"; + variables._fw1_version = "2.5.1"; /* - Copyright (c) 2009-2014, Sean Corfield, Marcin Szczepanski, Ryan Cogswell + Copyright (c) 2009-2015, Sean Corfield, Marcin Szczepanski, Ryan Cogswell Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,15 +17,9 @@ component { */ this.name = hash( getBaseTemplatePath() ); - if ( len( getContextRoot() ) ) { - variables.cgiScriptName = replace( CGI.SCRIPT_NAME, getContextRoot(), '' ); - variables.cgiPathInfo = replace( CGI.PATH_INFO, getContextRoot(), '' ); - } else { - variables.cgiScriptName = CGI.SCRIPT_NAME; - variables.cgiPathInfo = CGI.PATH_INFO; - } request._fw1 = { cgiScriptName = CGI.SCRIPT_NAME, + cgiPathInfo = CGI.PATH_INFO, cgiRequestMethod = CGI.REQUEST_METHOD, controllers = [ ], requestDefaultsInitialized = false, @@ -33,6 +27,10 @@ component { doTrace = false, trace = [ ] }; + if ( len( getContextRoot() ) ) { + request._fw1.cgiScriptName = replace( CGI.SCRIPT_NAME, getContextRoot(), '' ); + request._fw1.cgiPathInfo = replace( CGI.PATH_INFO, getContextRoot(), '' ); + } // do not rely on these, they are meant to be true magic... variables.magicApplicationSubsystem = ']['; variables.magicApplicationController = '[]'; @@ -2085,7 +2083,7 @@ component { variables.framework.action = 'action'; } if ( !structKeyExists(variables.framework, 'base') ) { - variables.framework.base = getDirectoryFromPath( variables.cgiScriptName ); + variables.framework.base = getDirectoryFromPath( request._fw1.cgiScriptName ); } else if ( right( variables.framework.base, 1 ) != '/' ) { variables.framework.base = variables.framework.base & '/'; } @@ -2232,7 +2230,7 @@ component { private void function setupRequestDefaults() { if ( !request._fw1.requestDefaultsInitialized ) { - var pathInfo = variables.cgiPathInfo; + var pathInfo = request._fw1.cgiPathInfo; request.base = variables.framework.base; request.cfcbase = variables.framework.cfcbase; @@ -2240,10 +2238,10 @@ component { request.context = { }; } // SES URLs by popular request :) - if ( len( pathInfo ) > len( variables.cgiScriptName ) && left( pathInfo, len( variables.cgiScriptName ) ) == variables.cgiScriptName ) { + if ( len( pathInfo ) > len( request._fw1.cgiScriptName ) && left( pathInfo, len( request._fw1.cgiScriptName ) ) == request._fw1.cgiScriptName ) { // canonicalize for IIS: - pathInfo = right( pathInfo, len( pathInfo ) - len( variables.cgiScriptName ) ); - } else if ( len( pathInfo ) > 0 && pathInfo == left( variables.cgiScriptName, len( pathInfo ) ) ) { + pathInfo = right( pathInfo, len( pathInfo ) - len( request._fw1.cgiScriptName ) ); + } else if ( len( pathInfo ) > 0 && pathInfo == left( request._fw1.cgiScriptName, len( pathInfo ) ) ) { // pathInfo is bogus so ignore it: pathInfo = ''; }