We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17775
    • 9 Posts
    I have a (TV)Template Variable that is calling to a Snippet to return some text. Want the TV to be sanitized, but for some reason ModX is not returning it.


    My template variable has the value "This & % ! @ ".

    Here is my code
    <?php
    $strInputName = "$sendString";
    
    $name = htmlentities($strInputName);
    
    $modx->setPlaceholder('firstName', $name);
    
    return $modx->getChunk('This');
    ?>


    If change my snippet var $strInputName = ’This & % ! @ ’; It returns properly with the HTMLENTITIES in place.

    When I change my Template Variable Widget: Htmlentities, it will display correctly only if I display the TV by itself. If I pass the TV to a snippet, then the htmlentities will be ignored.