Brave request Fix. Path seperator fix.
This commit is contained in:
parent
d971512a31
commit
6a122e3bed
4 changed files with 16 additions and 8 deletions
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue