mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1013 from tractorcow/pulls/3.2-fix-fulltext-query-encoding
BUG Fix encoding of SearchForm::getSearchQuery
This commit is contained in:
commit
30d42e06d6
@ -42,7 +42,7 @@ class ContentControllerSearchExtension extends Extension {
|
||||
public function results($data, $form, $request) {
|
||||
$data = array(
|
||||
'Results' => $form->getResults(),
|
||||
'Query' => $form->getSearchQuery(),
|
||||
'Query' => DBField::create_field('Text', $form->getSearchQuery()),
|
||||
'Title' => _t('SearchForm.SearchResults', 'Search Results')
|
||||
);
|
||||
return $this->owner->customise($data)->renderWith(array('Page_results', 'Page'));
|
||||
|
@ -27,6 +27,10 @@ class SearchForm extends Form {
|
||||
"SiteTree", "File"
|
||||
);
|
||||
|
||||
private static $casting = array(
|
||||
'SearchQuery' => 'Text'
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Controller $controller
|
||||
@ -186,7 +190,7 @@ class SearchForm extends Form {
|
||||
if(!isset($data)) $data = $_REQUEST;
|
||||
|
||||
// The form could be rendered without the search being done, so check for that.
|
||||
if (isset($data['Search'])) return Convert::raw2xml($data['Search']);
|
||||
if (isset($data['Search'])) return $data['Search'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user