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

Don't throw a Notice in calculateUri when passing an empty uri #941

Merged
merged 2 commits into from
Feb 8, 2017

Conversation

icewind1991
Copy link
Contributor

When a dav server listening on the root of a domain receives a request to the root of that domain, the request $uri will be an empty string.

Besides the one Notice that was thrown the rest of the implementation works correctly in that case ($uri = '', $baseUri = '/')

@@ -565,7 +565,7 @@ function getRequestUri() {
*/
function calculateUri($uri) {

if ($uri[0] != '/' && strpos($uri, ':https://')) {
if ($uri != '' && $uri[0] != '/' && strpos($uri, ':https://')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which uri do you expect calculateUri to return for this new case? please add a unit test for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test

@evert evert merged commit 14a8a13 into sabre-io:master Feb 8, 2017
@icewind1991 icewind1991 deleted the patch-1 branch February 8, 2017 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants