From edaf7097834572b4d0c4d53883a6c5694892324c Mon Sep 17 00:00:00 2001 From: Devlin Date: Fri, 24 May 2013 16:49:34 +0200 Subject: [PATCH] FIX #1971: Check if the search term is set --- model/fieldtypes/Text.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/model/fieldtypes/Text.php b/model/fieldtypes/Text.php index 993a24117..63d057381 100644 --- a/model/fieldtypes/Text.php +++ b/model/fieldtypes/Text.php @@ -239,7 +239,10 @@ class Text extends StringField { public function ContextSummary($characters = 500, $string = false, $striphtml = true, $highlight = true, $prefix = "... ", $suffix = "...") { - if(!$string) $string = $_REQUEST['Search']; // Use the default "Search" request variable (from SearchForm) + if(!$string) { + // Use the default "Search" request variable (from SearchForm) + $string = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : ''; + } // Remove HTML tags so we don't have to deal with matching tags $text = $striphtml ? $this->NoHTML() : $this->value;