/** * Filter: removes unnecessary whitespace and shortens value to control's max length. * @return string */ public function sanitize($value) { if ($this->control->maxlength && Strings::length($value) > $this->control->maxlength) { $value = Strings::substring($value, 0, $this->control->maxlength); } return Strings::trim(strtr($value, "\r\n", ' ')); }