Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Need help... Context validation error for tag cfscript.

Engaged ,
Sep 10, 2009 Sep 10, 2009

Code:

    <cffunction name="computeHash" access="public" returntype="String">
      <cfargument name="password" type="string" />
      <cfargument name="salt" type="string" />
      <cfargument name="iterations" type="numeric" required="false" default="1024" />
      <cfargument name="algorithm" type="string" required="false" default="SHA512" />
      <cfscript>
        var hashed = '';
        var i = 1;
        hashed = hash( password & salt, arguments.algorithm, 'UTF-8' );
        for (i = 1; i <= iterations; i++) {
          hashed = hash( hashed & salt, arguments.algorithm, 'UTF-8' );
        }
        return hashed;
      </cfscript>
    </cffunction>

Error on web app:

Context  validation error for tag cfscript.

The start tag must have a matching  end tag. An explicit end tag can be provided by adding </cfscript>. If the  body of the tag is empty you can use the shortcut <cfscript .../>.

The CFML compiler was processing:

  • a cfscript tag beginning on line 11, column 12.
  • a cfscript tag beginning on line 11, column 12.
The  error occurred in xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\salty.cfc: line  11
9 :        <cfargument name="iterations" type="numeric" required="false" default="1024" />
10 :        <cfargument name="algorithm" type="string" required="false" default="SHA512" />
11 :        <cfscript>
12 :           var hashed = '';
13 :           var i = 1;

I am completely lost on why it's fumbling with why it says there's no closing tag.  Help!!!!

Thanks

5.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 10, 2009 Sep 10, 2009

What's on lines 1-7 of that file?

That code compiles fine for me on CF8 & CF9, so that's not where the error is.

You're not trying to compile it on any earlier version of CF than CF8 are you?  The < and ++ operators are not valid prior to CF8.  CFMX7 might see the < as a stray angle bracket, and get confused.  I don't have CFMX7 running here to test the exact error that would produce, sorry.

--

Adam

Translate
LEGEND ,
Sep 10, 2009 Sep 10, 2009

What's on lines 1-7 of that file?

That code compiles fine for me on CF8 & CF9, so that's not where the error is.

You're not trying to compile it on any earlier version of CF than CF8 are you?  The < and ++ operators are not valid prior to CF8.  CFMX7 might see the < as a stray angle bracket, and get confused.  I don't have CFMX7 running here to test the exact error that would produce, sorry.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 10, 2009 Sep 10, 2009
LATEST

I am running MX7.

Looks like you are correct.

Also, my algorithm apparently isn't supported in CF7 either

edit: nvm, it's not SHA512, it's SHA-512 in CF7.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources