Permalink
Browse files

simplistic fix for atuttle/Taffy#55

When trying to get the path to the resource directory, strip out the
context root.
  • Loading branch information...
1 parent 0838b63 commit 5c2fc7c5dcdcf439d36c06b50c1a18f538cf19e7 @coke committed Feb 8, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 core/api.cfc
View
5 core/api.cfc
@@ -494,6 +494,9 @@
<cffunction name="guessResourcesPath" access="private" output="false" returntype="string" hint="used to try and figure out the absolute path of the /resources folder even though this file may not be in the web root">
<cfset local.indexcfmpath = cgi.script_name />
<cfset local.resourcesPath = listDeleteAt(local.indexcfmpath, listLen(local.indexcfmpath, "/"), "/") & "/resources" />
+ <cfif GetContextRoot() NEQ "">
+ <cfset local.resourcesPath = ReReplace(local.resourcesPath,"^#GetContextRoot()#","")>
+ </cfif>
<cfreturn local.resourcesPath />
</cffunction>
@@ -819,4 +822,4 @@
</cfif>
</cffunction>
-</cfcomponent>
+</cfcomponent>

0 comments on commit 5c2fc7c

Please sign in to comment.