Permalink
Browse files

FIX #1971: Check if the search term is set

  • Loading branch information...
1 parent 916de30 commit edaf7097834572b4d0c4d53883a6c5694892324c @JayDevlin JayDevlin committed May 24, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 model/fieldtypes/Text.php
@@ -239,7 +239,10 @@ public function FirstParagraph($plain = 1) {
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;

0 comments on commit edaf709

Please sign in to comment.