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