Skip to content

Commit

Permalink
Merge pull request #67 from mcetkovsky/2018/10/fix-azure-url-api-check
Browse files Browse the repository at this point in the history
Fixes the url generated for graphs.windows.net queries
  • Loading branch information
hajekj authored Oct 16, 2018
2 parents c57dcb6 + 9bee0a4 commit b6969ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Provider/Azure.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,15 @@ public function request($method, $ref, &$accessToken, $options = [])
if (filter_var($ref, FILTER_VALIDATE_URL) !== FALSE) {
$url = $ref;
} else {
if (strpos($this->urlAPI, "graph.windows.net") === TRUE) {
if (strpos($this->urlAPI, "graph.windows.net") !== FALSE) {
$tenant = 'common';
if (property_exists($this, 'tenant')) {
$tenant = $this->tenant;
}
$ref = "$tenant/$ref";

$url = $this->urlAPI.$ref;

$url .= (strrpos($url, "?") === false) ? "?" : "&";
$url .= "api-version=".$this->API_VERSION;
}
Expand Down

0 comments on commit b6969ac

Please sign in to comment.