New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate sanitizer #163

adrianbj opened this Issue Mar 9, 2018 · 3 comments


None yet
3 participants

adrianbj commented Mar 9, 2018

Short description of the enhancement

Add a truncate() method to the sanitizer class.

Current vs. suggested behavior

Maybe the sanitizer class isn't the right place for it - maybe just a public function: wireTruncate() or something?

Why would the enhancement be useful to users?

I think this is a very common need and it would be nicer than using our own versions.

Optional: Screenshots/Links that demonstrate the enhancement

I think you could make use of this function:


This comment has been minimized.

teppokoivula commented Mar 10, 2018

Definitely makes sense. This is something that I've needed on every ProcessWire site I've built so far, more or less. Makes sense not to reinvent the wheel every single time :)


This comment has been minimized.

rolandtoth commented Mar 11, 2018

It would be nice if it could take html tags into account, but using strip_tags is also better than nothing.

In my Latte module I'm using this code, perhaps it can help too:


This comment has been minimized.

adrianbj commented May 4, 2018

Brilliant - thanks @ryancramerdesign

@adrianbj adrianbj closed this May 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment