Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for graph.windows.net sounds bogus #65

Closed
mcetkovsky opened this issue Oct 9, 2018 · 7 comments
Closed

Check for graph.windows.net sounds bogus #65

mcetkovsky opened this issue Oct 9, 2018 · 7 comments
Labels

Comments

@mcetkovsky
Copy link

mcetkovsky commented Oct 9, 2018

Azure.php:186 contains the following check:

if (strpos($this->urlAPI, "graph.windows.net") === TRUE)

As of PHP Docs, the strpos returns either FALSE or unsigned int. It never specifically returns TRUE.

Instead, I would expect the condition to be

if (strpos($this->urlAPI, "graph.windows.net") !== FALSE)

but I am not sure yet what the code is supposed to do.

It is also strange that if the condition would evaluate to true, the $url is always null so the condition strrpos($url, "?") === false on line 193 always passes. As such, the complete url that the branch generates is ?api-version=1.6 (it completely ignores and missed the tenant and ref parts which is strange).

@hajekj
Copy link
Member

hajekj commented Oct 9, 2018

Yes you are absolutely right, could you please make a pull request to fix this?

@hajekj hajekj added the bug label Oct 9, 2018
@mcetkovsky
Copy link
Author

I can for the condition. But I am not sure what is the supposed way to build the $url.

@hajekj
Copy link
Member

hajekj commented Oct 9, 2018

I will check on that and get back to you.

@mcetkovsky
Copy link
Author

My guess that the following line is missing in the branch:

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

@hajekj
Copy link
Member

hajekj commented Oct 16, 2018

I have merged the PR. I will be releasing it as 1.4.1 shortly. Thanks for the PR!

@jonty-comp
Copy link
Contributor

Hi, could you release the v1.4.1 update? We've just updated from 1.3 in our dev and it's stopped working due to this bug!

@hajekj
Copy link
Member

hajekj commented Dec 22, 2018

Hi, I have just released 1.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants