Skip to content

Commit 014168f

Browse files
committed
Querystring on URL
1 parent 02d9d6f commit 014168f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/ApiRequestDetail.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,25 @@ class ApiRequestDetail implements IApiRequestDetail
1717
*/
1818
public function getUrl()
1919
{
20-
return $this->_url;
20+
if(empty($this->_query))
21+
{
22+
return $this->_url;
23+
}
24+
25+
if(substr($this->_url, -1, 1) == '?')
26+
{
27+
$glue = '';
28+
}
29+
else if(stristr($this->_url, '?'))
30+
{
31+
$glue = '&';
32+
}
33+
else
34+
{
35+
$glue = '?';
36+
}
37+
38+
return $this->_url . $glue . http_build_query($this->_query);
2139
}
2240

2341
/**

0 commit comments

Comments
 (0)