tracker issue : CF-3040322

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 80408:(Watson Migration Closure)I have this: <a href="/#getSetting('defaultPage')#">Home</a>Yields / index

| View in Tracker

Status/Resolution/Reason: To Track/Fixed/PRNeedInfo

Reporter/Name(from Bugbase): Brian J Meloche / Brian J Meloche (Brian J Meloche)

Created: 10/19/2009

Components: General Server

Versions: 2016,11.0,2018

Failure Type: Unspecified

Found In Build/Fixed In Build: 251028 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_not_fixed on February 18, 2019 using build 2016.0.01.298513
Problem:

I have this: <a href="/#getSetting('defaultPage')#">Home</a>Yields / index.cfm with a space.If I change it to this: <a href="#getSetting('defaultPage')#">Home</a>I get index.cfm without a space.Also, if I use this: <a href="/#variables.settings.defaultPage#">Home</a>I get /index.cfm without a space.It seems to be the combination of the / with the function call that generates the space in front of it. I have verified that #getSetting('defaultPage')# gives me index.cfm without a space.
Method:

I can supply code which generates the example.

[vmannebo 11/11/2009] Adding a reproducible case:

1) create a folder called bugs/80408 under webroot
2) place main.cfm and _80408.cfm under /bugs/80408/

main.cfm
--------
<cfoutput><a href="#getSetting('_80408.cfm')#" target="blank">Link 1</a></cfoutput><br>
<cfoutput><a href="/#getSetting('bugs/80408/_80408.cfm')#" target="blank">Link 2</a></cfoutput>


<cffunction name="getSetting">
	<cfargument name="defaultpage">
	<cfreturn defaultpage>
</cffunction>

_80408.cfm
This is a test page
Result:

/ index.cfm not found.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3040322

External Customer Info:
External Company:  
External Customer Name: Brian J Meloche
External Customer Email: 04C7536843D1BE67992015D5
External Test Config: 10/19/2009

Attachments:

Comments:

Verified the issue in CF9, CF10 and CF11. (Comment added from ex-user id:duttswam)
Comment by Adobe D.
22657 | December 08, 2014 03:06:09 AM GMT
Fix verified on ColdFusion build #294196 (Comment added from ex-user id:duttswam)
Comment by Adobe D.
22658 | June 16, 2015 04:06:29 AM GMT
Hi Adobe, This is NOT fixed in any of: 11.0.07.296330, 2016.0.01.298513, 2018.0.0.310739. Ticket needs changed back to ToFix, and removed from CF2016's Issues Fixed list: https://helpx.adobe.com/content/dam/help/attachments/cf2016-issues-fixed.pdf The repro in the description still generates whitespace, breaking the hyperlink. Another repro is this: Application.cfc ----------- component {THIS.name = "ticket_3040322";} ----------- index.cfm ----------- <cfoutput>|#myFunction('myString')#|</cfoutput> <cffunction name="myFunction"> <cfreturn ARGUMENTS[1]></cffunction> ----------- mypage.cfm ----------- This is a test page ----------- Specifically, the newline before the <cfreturn> adds the whitespace. Of course, setting output="false" on <cffunction> also resolves the issue. But, if you're saying the issue described in the description is fixed, that is wrong b/c it is not. Thanks!, -Aaron
Comment by Aaron N.
30300 | February 18, 2019 02:15:20 AM GMT
To clarify, <cfoutput>|#myFunction('myString')#|</cfoutput> displays | myString| instead of |myString|. Thanks!, -Aaron
Comment by Aaron N.
30301 | February 18, 2019 02:23:22 AM GMT
LOL, the mypage.cfm isn't even relevant in my example and can be ignored ;)
Comment by Aaron N.
30302 | February 18, 2019 02:24:29 AM GMT
Hi Aaraon, I have reopened this bug as per your request and we are verifying the same. -Nitin
Comment by Nitin K.
30307 | February 18, 2019 10:04:19 AM GMT
Hi Nitin, Awesome, sure, thank you very much!! -Aaron
Comment by Aaron N.
30315 | February 18, 2019 01:13:48 PM GMT
As per our documentation, the behavior is as designed. It says - |output|Optional|Function body is processed as standard CFML|Specifies under which conditions the function can generate HTML output. The following values are valid: ·         yes: the entire function body is processed as if it were in a cfoutput tag. Variables names surrounded by number signs (#) are automatically replaced with their values. ·         no: the function is processed as if it were within a cfsilent tag. If you do not specify this attribute, the function body is processed as standard CFML. Any variables must be in cfoutput tags.| So, entire body of cffunction is processed like cfoutput tag. That's why all /n /r characters are also written to output. In the testcase mentioned, function is returning the value correctly and all the body of function is written to html output which looks like space when rendered in the browser. [https://helpx.adobe.com/in/coldfusion/cfml-reference/coldfusion-tags/tags-f/cffunction.html]
Comment by Nikhil D.
30759 | May 16, 2019 02:43:34 PM GMT
Hi Aaron, Previous comment from Nikhil looks convincing to me. Please let us know if you have any concerns. Regards, Nitin
Comment by Nitin K.
30760 | May 17, 2019 07:44:11 AM GMT