Jump to content

$sanitizer truncating text field - defaults are set where?


Smoo
 Share

Recommended Posts

Hi folks.
I'm finding our email contact form is truncating messages, whose body is coming from a text area, to 50 characters.
Turning off sanitizer for that field removes the problem:

//$message = $sanitizer->text($input->post->message); -- truncates
$message = $input->post->message; // -- passes full text

However I'd still like to have some cleanup performed on user-generated input.
Is there a way to set a higher character count for this field?

TIA...

Link to comment
Share on other sites

See all the options available here:

https://processwire.com/api/variables/sanitizer/

Quote

$options that may be provided to the text() and textarea() functions

The values given here are the default value when ommitted from the text() function.


$options = array(
    // set to true to allow multiple lines of copy
    'multiLine' => false,
    // maximum allowed characters for multibyte strings
    'maxLength' => 255,
    // maximum number of bytes allowed in the string (multibyte safe)
    'maxBytes' => 1024,
    // strip markup tags
    'stripTags' => true,
    // markup tags that are allowed. Example: "<strong><em>"
    'allowableTags' => '',
    // character to replace newlines with, OR specify boolean TRUE to remove extra lines
    'newlineReplacement' => ' ',
    // character set of $value provided
    'inCharset' => 'UTF-8',
    // character set to convert to (if different from inCharset)
    'outCharset' => 'UTF-8'
); 

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...