mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: check if a request is present before using it to prevent undefined errors
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104608 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
17c67c7869
commit
bec9438973
@ -15,7 +15,12 @@ class ContentControllerSearchExtension extends Extension {
|
|||||||
* Site search form
|
* Site search form
|
||||||
*/
|
*/
|
||||||
function SearchForm() {
|
function SearchForm() {
|
||||||
$searchText = ($s = $this->owner->request->getVar('Search')) ? $s : _t('SearchForm.SEARCH', 'Search');
|
$searchText = _t('SearchForm.SEARCH', 'Search');
|
||||||
|
|
||||||
|
if($this->owner->request) {
|
||||||
|
$searchText = $this->owner->request->getVar('Search');
|
||||||
|
}
|
||||||
|
|
||||||
$fields = new FieldSet(
|
$fields = new FieldSet(
|
||||||
new TextField('Search', false, $searchText)
|
new TextField('Search', false, $searchText)
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user