예제 #1
0
	/**
	 * 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", '  '));
	}
예제 #2
0
파일: TextBase.php 프로젝트: krecek/nrsn
	/**
	 * 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;
	}