Skip to content

Commit

Permalink
Merge pull request #2 from ViT4RGh0ST/master
Browse files Browse the repository at this point in the history
fix: issue with raw urls when there's no query parameters
  • Loading branch information
AlexR1712 authored Apr 21, 2022
2 parents bda20d6 + 31abb54 commit 22e6be2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions SAPb1/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function findAll(callable $callback = null) : object{
private function doRequest(string $action = '', callable $callback = null){

// Build the query string.
$requestQuery = '?';
$requestQuery = '';

foreach($this->query as $name => $value){
$requestQuery .= '$' . $name . '=' . rawurlencode($value) . '&';
Expand All @@ -149,9 +149,9 @@ private function doRequest(string $action = '', callable $callback = null){
$requestQuery .= rawurlencode($op . $filter->execute());
}
}

// Execute the service API with the query string.
$request = new Request($this->config->getServiceUrl($this->serviceName . $action) . $requestQuery, $this->config->getSSLOptions());
$request = new Request($this->config->getServiceUrl($this->serviceName . $action) . ($requestQuery !== '' ? '?' : '') . $requestQuery, $this->config->getSSLOptions());
$request->setMethod('GET');
$request->setHeaders($this->headers);

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "emetra/php-sapb1",
"name": "blockshiftnetwork/php-sapb1",
"type": "library",
"description": "SAP Business One Library for PHP, forked from syedhussim/php-sapb1",
"description": "SAP Business One Library for PHP, forked from blockshiftnetwork/php-sapb1",
"keywords": ["sap"],
"homepage": "https://github.com/emetra/php-sapb1",
"homepage": "https://github.com/blockshiftnetwork/php-sapb1",
"license": "MIT",
"authors": [
{
Expand Down

0 comments on commit 22e6be2

Please sign in to comment.