Merge pull request #1990 from JayDevlin/1971-text-contextsummary

FIX #1971: Text->ContextSummary
This commit is contained in:
Will Rossiter 2013-05-24 15:19:48 -07:00
commit 438066dc14

View File

@ -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;