Skip to content

Commit 0927e55

Browse files
authored
Merge pull request #76 from farcrycore/p720-FC-3138
FC-3138 validate url.type against stCOAPI
2 parents 050d2b3 + 264e9c4 commit 0927e55

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tags/navajo/display.cfm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@
6868
<cfparam name="url.type" default="" />
6969
<cfparam name="url.view" default="" />
7070

71+
<!--- ensure application.stCOAPI record exists for url.type --->
72+
<cfif NOT structKeyExists(application.stCOAPI, url.type)>
73+
<cfset url.type = "">
74+
</cfif>
7175

7276
<!--- get standard webskin names by device type --->
7377
<cfset stWebskins = application.fc.lib.device.getDeviceWebskinNames()>
@@ -227,10 +231,10 @@
227231
</cfif>
228232

229233
<!--- either stream the webskin result with an appropriate mime type, or output it normally --->
230-
<cfif len(url.type) AND len(url.view) AND application.stCOAPI[url.type].stWebskins[url.view].viewstack eq "ajax">
234+
<cfif len(url.type) AND len(url.view) AND structKeyExists(application.stCOAPI, url.type) AND structKeyExists(application.stCOAPI[url.type].stWebskins, url.view) AND application.stCOAPI[url.type].stWebskins[url.view].viewstack eq "ajax">
231235
<cfset request.mode.ajax = true />
232236
</cfif>
233-
<cfif len(url.type) AND len(url.view) AND application.stCOAPI[url.type].stWebskins[url.view].viewstack eq "data" AND structkeyexists(application.stCOAPI[url.type].stWebskins[url.view],"mimeType")>
237+
<cfif len(url.type) AND len(url.view) AND structKeyExists(application.stCOAPI, url.type) AND structKeyExists(application.stCOAPI[url.type].stWebskins, url.view) AND application.stCOAPI[url.type].stWebskins[url.view].viewstack eq "data" AND structkeyexists(application.stCOAPI[url.type].stWebskins[url.view],"mimeType")>
234238
<cfset request.mode.ajax = true />
235239

236240
<cfinvoke component="#application.fapi#" method="stream">
@@ -340,4 +344,4 @@
340344

341345
<core:displayTray />
342346

343-
<cfsetting enablecfoutputonly="false" />
347+
<cfsetting enablecfoutputonly="false" />

0 commit comments

Comments
 (0)