BUGFIX #3061: Text.FirstSentence returns '.' instead of '' on an empty field

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@65842 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-11-13 21:02:54 +00:00
parent 7318977194
commit 05e042427b

View File

@ -96,6 +96,8 @@ class Text extends DBField {
*/ */
function FirstSentence() { function FirstSentence() {
$data = Convert::xml2raw( $this->value ); $data = Convert::xml2raw( $this->value );
if( !$data ) return "";
$sentences = explode( '.', $data ); $sentences = explode( '.', $data );