Changeset 294
- Timestamp:
- 12/25/06 18:49:31 (2 years ago)
- Location:
- framework/trunk
- Files:
-
- 4 modified
-
fuseboxApplication.cfc (modified) (3 diffs)
-
fuseboxCircuit.cfc (modified) (1 diff)
-
fuseboxPlugin.cfc (modified) (1 diff)
-
myFusebox.cfc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
framework/trunk/fuseboxApplication.cfc
r293 r294 60 60 hint="I am FUSEBOX_CALLER_PATH." /> 61 61 62 <!--- fixes ticket 54--->62 <!--- fixes ticket 163 ---> 63 63 <cfset var myVersion = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#" /> 64 64 … … 75 75 <cfset variables.coreRoot = replace(getDirectoryFromPath(getCurrentTemplatePath()),"\","/","all") /> 76 76 77 <cfset this.approotdirectory = normalizePartialPath(arguments.callerPath) & normalizePartialPath(arguments.appPath) /> 78 <!--- remove pairs of directory/../ to form canonical path: ---> 79 <cfloop condition="find('/../',this.approotdirectory) gt 0"> 80 <cfset this.approotdirectory = REreplace(this.approotdirectory,"[^\.:/]*/\.\./","") /> 81 </cfloop> 77 <cfset this.approotdirectory = getCanonicalPath(normalizePartialPath(arguments.callerPath) & normalizePartialPath(arguments.appPath)) /> 78 82 79 <!--- this works on all platforms: ---> 83 80 <cfset this.osdelimiter = "/" /> … … 1061 1058 </cffunction> 1062 1059 1060 <cffunction name="getCanonicalPath" returntype="string" access="public" output="false" 1061 hint="I return a canonical file path (with all /../ sections resolved)."> 1062 <cfargument name="path" type="string" required="true" 1063 hint="I am the path to resolve." /> 1064 1065 <cfset var resolvedPath = arguments.path /> 1066 <cfset var leadingSlash = left(resolvedPath,1) is "/" /> 1067 <cfset var trailingSlash = right(resolvedPath,1) is "/" /> 1068 <cfset var segment = ""/> 1069 <cfset var j = 1 /> 1070 <cfset var n = 0 /> 1071 <cfset var pathParts = arrayNew(1) /> 1072 <cfset var delimiter = "" /> 1073 1074 <!--- remove pairs of directory/../ ---> 1075 <cfloop list="#resolvedPath#" delimiters="/" index="segment"> 1076 <cfif segment is "."> 1077 <!--- just ignore this ---> 1078 <cfelseif segment is ".."> 1079 <cfif j gt 1 and pathParts[j-1] is not ".."> 1080 <cfset j = j - 1 /> 1081 <cfelse> 1082 <cfset pathParts[j] = segment /> 1083 <cfset j = j + 1 /> 1084 </cfif> 1085 <cfelse> 1086 <cfset pathParts[j] = segment /> 1087 <cfset j = j + 1 /> 1088 </cfif> 1089 </cfloop> 1090 1091 <!--- rebuild the path ---> 1092 <cfif leadingSlash> 1093 <cfset delimiter = "/" /> 1094 </cfif> 1095 <cfset resolvedPath = "" /> 1096 <cfset n = j - 1 /> 1097 <cfloop from="1" to="#n#" index="j"> 1098 <cfset resolvedPath = resolvedPath & delimiter & pathParts[j] /> 1099 <cfset delimiter = "/" /> 1100 </cfloop> 1101 <cfif trailingSlash> 1102 <cfset resolvedPath = resolvedPath & "/" /> 1103 </cfif> 1104 1105 <cfreturn resolvedPath /> 1106 1107 </cffunction> 1108 1063 1109 <cffunction name="normalizePartialPath" returntype="string" access="public" output="false" 1064 hint=" ">1110 hint="I return a normalized file path (that has / instead of \ and ends with /)."> 1065 1111 <cfargument name="partialPath" type="string" required="true" 1066 hint=" " />1112 hint="I am the path to normalize." /> 1067 1113 1068 1114 <cfset var unixPath = replace(arguments.partialPath,"\","/","all") /> -
framework/trunk/fuseboxCircuit.cfc
r292 r294 69 69 </cfif> 70 70 </cfif> 71 <!--- remove pairs of directory/../ to form canonical path: ---> 72 <cfloop condition="find('/../',variables.fullPath) gt 0"> 73 <cfset variables.fullPath = REreplace(variables.fullPath,"[^\.:/]*/\.\./","") /> 74 </cfloop> 71 72 <cfset variables.fullPath = variables.fuseboxApplication.getCanonicalPath(variables.fullPath) /> 73 75 74 <!--- 76 75 this was not correctly normalized prior to ticket 139 but it didn't really matter -
framework/trunk/fuseboxPlugin.cfc
r292 r294 110 110 this.path,arguments.fbApp.getApplicationRoot()) /> 111 111 </cfif> 112 <!--- remove pairs of directory/../ to form canonical path: ---> 113 <cfloop condition="find('/../',this.rootpath) gt 0"> 114 <cfset this.rootpath = REreplace(this.rootpath,"[^\.:/]*/\.\./","") /> 115 </cfloop> 112 113 <cfset this.rootpath = arguments.fbApp.getCanonicalPath(this.rootpath) /> 116 114 117 115 <cfset variables.parameters = arguments.pluginXML.xmlChildren /> -
framework/trunk/myFusebox.cfc
r293 r294 16 16 <cfcomponent hint="I provide the per-request myFusebox data structure and some convenience methods."> 17 17 <cfscript> 18 // fixes ticket 5418 // fixes ticket 163 19 19 this.version.runtime = "5.0.1.#REReplace('$LastChangedRevision$','[^0-9]','','all')#"; 20 20
