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 (from r104608)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112357 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3a6b79a6f3
commit
55294b1f96
@ -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