Brave request Fix. Path seperator fix.

This commit is contained in:
Fabian de Boer 2026-07-17 12:34:37 +02:00
commit 6a122e3bed
4 changed files with 16 additions and 8 deletions

View file

@ -21,8 +21,20 @@ class Brave implements Search {
public function setQuery($word) {
$this->word = $word;
}
$request = $this->q_prefix . urlencode($word);
public function getData() {
$this->buildRequest();
$return_array = $this->prepareData();
return $return_array;
}
/**
* Build the request URL and cURL handle after all setParam() calls have been made.
* This ensures start/offset and size are available when constructing the URL.
*/
private function buildRequest() {
$request = $this->q_prefix . urlencode($this->word);
if (isset($this->start)) {
$request .= '&offset=' . $this->start;
}
@ -38,11 +50,6 @@ class Brave implements Search {
$this->$key = $value;
}
public function getData() {
$return_array = $this->prepareData();
return $return_array;
}
/**
* Prepare a project wide universal array with results
*/