The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit aee8e2eb authored by Demian Katz's avatar Demian Katz
Browse files

Avoid notices.

parent 73740893
No related merge requests found
......@@ -160,9 +160,11 @@ class InjectSpellingListener
$result = $event->getTarget();
$params = $event->getParam('params');
$spellcheckQuery = $params->get('spellcheck.q');
$this->aggregateSpellcheck(
$result->getSpellcheck(), end($spellcheckQuery)
);
if (!empty($spellcheckQuery)) {
$this->aggregateSpellcheck(
$result->getSpellcheck(), end($spellcheckQuery)
);
}
}
}
......
......@@ -98,11 +98,13 @@ class RecordCollection extends AbstractRecordCollection
public function getSpellcheck()
{
if (!$this->spellcheck) {
$sq = isset($this->response['responseHeader']['params']['spellcheck.q'])
? $this->response['responseHeader']['params']['spellcheck.q']
: $this->response['responseHeader']['params']['q'];
$this->spellcheck
= new Spellcheck($this->response['spellcheck']['suggestions'], $sq);
$params = isset($this->response['responseHeader']['params'])
? $this->response['responseHeader']['params'] : array();
$sq = isset($params['spellcheck.q'])
? $params['spellcheck.q'] : $params['q'];
$sugg = isset($this->response['spellcheck']['suggestions'])
? $this->response['spellcheck']['suggestions'] : array();
$this->spellcheck = new Spellcheck($sugg, $sq);
}
return $this->spellcheck;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment