mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Moving NoHTML function from Text to StringField
This change will make the NoHTML function available for Varchar fields in particular.
This commit is contained in:
parent
a77ca1995a
commit
d5361dedec
@ -21,6 +21,7 @@ abstract class StringField extends DBField {
|
||||
'LimitWordCountXML' => 'HTMLText',
|
||||
"LowerCase" => "Text",
|
||||
"UpperCase" => "Text",
|
||||
'NoHTML' => 'Text',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -187,4 +188,13 @@ abstract class StringField extends DBField {
|
||||
public function UpperCase() {
|
||||
return mb_strtoupper($this->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of the field stripped of html tags.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function NoHTML() {
|
||||
return strip_tags($this->value);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ class Text extends StringField {
|
||||
'EscapeXML' => 'Text',
|
||||
'LimitWordCount' => 'Text',
|
||||
'LimitWordCountXML' => 'HTMLText',
|
||||
'NoHTML' => 'Text',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -53,15 +52,6 @@ class Text extends StringField {
|
||||
DB::requireField($this->tableName, $this->name, $values, $this->default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of the field stripped of html tags.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function NoHTML() {
|
||||
return strip_tags($this->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of the field with relative links converted to absolute urls.
|
||||
* @return string
|
||||
|
Loading…
Reference in New Issue
Block a user