mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX #1971: Check if the search term is set
This commit is contained in:
parent
916de30204
commit
edaf709783
@ -239,7 +239,10 @@ class Text extends StringField {
|
|||||||
public function ContextSummary($characters = 500, $string = false, $striphtml = true, $highlight = true,
|
public function ContextSummary($characters = 500, $string = false, $striphtml = true, $highlight = true,
|
||||||
$prefix = "... ", $suffix = "...") {
|
$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
|
// Remove HTML tags so we don't have to deal with matching tags
|
||||||
$text = $striphtml ? $this->NoHTML() : $this->value;
|
$text = $striphtml ? $this->NoHTML() : $this->value;
|
||||||
|
Loading…
Reference in New Issue
Block a user