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:
Ingo Schommer 2010-10-15 00:31:26 +00:00
parent 3a6b79a6f3
commit 55294b1f96

View File

@ -15,7 +15,12 @@ class ContentControllerSearchExtension extends Extension {
* Site search form
*/
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(
new TextField('Search', false, $searchText)
);