We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38017
    • 18 Posts
    I have a form that has a custom hook that I dump into SalesForce. I am experiencing a strange issue with character encoding.

    I used the debug to see why that field was getting truncated by SalesForce.
    ---
    debug result
    ---
    I  (& # 0 3 9 ;) here to say I really appreciate all "your" help on is (& # 0 3 9 ;)debug(& # 0 3 9 ;) process.
      [00N70000001yXBw] => I’m here to say I really appreciate all "your" help on is ’debug’ process.

    ---
    debug result
    ---

    It seams
    (& # 0 3 9 ;)
    if forcing SalesForce to remove anything after that character. No issues with
    "


    Any help would be greatly appreciated.

    The only thing I am doing now is Formit validation of strip^'^ which seams to help but I really want all the info to just go into the field.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Apparently they have some kind of incoming data validation that requires incoming single quotes be escaped.

      https://developer.salesforce.com/forums/?id=906F000000093dmIAA
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 13428 ☆ A M B ☆
        • 1,031 Posts
        The latest FormIt versions have a security feature in it. The field input is handled by htmlspecialchars to avoid XSS by default. To suppress this for a special field, you have to add the allowSpecialChars validator on that field.

        [[!FormIt? &validate=`message:allowSpecialChars`]]


        That way the special chars (Quotes, <, > and &) in that field are not replaced with their entities.
          • 38017
          • 18 Posts
          Quote from: sottwell at Apr 07, 2016, 12:15 AM
          Apparently they have some kind of incoming data validation that requires incoming single quotes be escaped.

          https://developer.salesforce.com/forums/?id=906F000000093dmIAA

          I was trying to escape the data in PHP but not having much luck at all or I was handling it all wrong (most likely wrong handling smiley ).

          Quote from: Jako at Apr 07, 2016, 01:16 AM
          The latest FormIt versions have a security feature in it. The field input is handled by htmlspecialchars to avoid XSS by default. To suppress this for a special field, you have to add the allowSpecialChars validator on that field.

          [[!FormIt? &validate=`message:allowSpecialChars`]]


          That way the special chars (Quotes, <, > and &) in that field are not replaced with their entities.

          That worked perfectly!!! Thank you Jako I could not find that piece anywhere online (https://rtfm.modx.com/extras/revo/formit/formit.validators)
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            It's there, in the grid of Built-In Validators
            allowSpecialChars - Don't replace HTML special chars with their entities. Note that this is on by default. - message:allowSpecialChars
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 38017
              • 18 Posts
              I completely overlooked that. Thank you. Says it's on by default but apparently not.
                • 13428 ☆ A M B ☆
                • 1,031 Posts
                I have added that allowSpecialChars option today to the docs, after writing the post. So maybe it was not there, when you looked for it.

                Quote from: rcarnrick at Apr 07, 2016, 01:11 PM
                Says it's on by default but apparently not.

                Fixed in the docs, thanks.