Jump to content

sanitizer: line() and lines() vs text() and textarea()


DrQuincy
 Share

Recommended Posts

23 minutes ago, DrQuincy said:

What are the differences?

I am not sure it can be any clearer than what is already stated in the respective documentation.

$sanitizer line() (emphasis is mine).

Quote

Sanitize any string of text to single line, no HTML, and no specific max-length (unless given)

This is the same as the text() sanitizer but does not impose a maximum character length (or byte length) unless given one in the $maxLength argument. This is useful in cases where the text sanitizer’s built in 255 character max length (1020 max bytes) is not enough, or when you want to specify a max length as part of the method arguments.

Please note that like with the text sanitizer, the max length refers to a maximum number of characters, not bytes. The maxBytes is automatically set to the maxLength * 4, or can be specifically set via the maxBytes option.

$sanitizer->lines().

Quote

This is the same as the textarea() sanitizer but does not impose a maximum character length (or byte length) unless given one in the $maxLength argument.

 

  • 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...