Link to home
Start Free TrialLog in
Avatar of happydog234
happydog234

asked on

Coldfusion: Leading Space Bug

I swear, this function returns an undetectable leading space.

If I pass the function to a mid, and start at char 2, it starts on char 2 of the non-leading space version.  Yet if I surrond the function like this
 [#func#]

there is space between the first [ and the beginning of the ourput.  No lie.  I swear to god.  I even tired this:
 #mid(f_publish_news_get_filename(11),2,len(f_publish_news_get_filename))#

and it returned it as if there was no leading space.  Here is the function:

<cffunction name="f_publish_news_get_filename" returntype="string">

      <cfargument name=id default="0">

      <cfset var q1 = querynew("")>
      <cfset var str = "">

      <cfif id EQ 0>

            <cfreturn 0>

      <cfelse>

            <cfquery name=q1 datasource=dramanet>
            SELECT id, posted_date FROM news WHERE id = #id#
            </cfquery>

            <cfset str = trim("#q1.posted_date##q1.id#.html")>

            <cfreturn str>

      </cfif>

</cffunction>

ASKER CERTIFIED SOLUTION
Avatar of jyokum
jyokum
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial