Skip to content

[6.x] Fix database url parsing for connections with no database specified#31185

Merged
taylorotwell merged 2 commits intolaravel:6.xfrom
danieloliveira079:fix-redis-url-parsing
Jan 21, 2020
Merged

[6.x] Fix database url parsing for connections with no database specified#31185
taylorotwell merged 2 commits intolaravel:6.xfrom
danieloliveira079:fix-redis-url-parsing

Conversation

@danieloliveira079
Copy link
Copy Markdown
Contributor

@danieloliveira079 danieloliveira079 commented Jan 21, 2020

This PR fixes how a database URL is parsed when the URL does not specify the database bit but ends with an /.

For example:
REDIS_URL="redis://h:asdfqwer1234asdf@ec2-111-1-1-1.compute-1.amazonaws.com:111/"

Before this fix the results from getDatabase($url) would be path=/. Consequently, affecting how arrays are filtered on RedisManager.php

A test case has been added to cover this scenario.

This REDIS_URL format is very similar to what you can find when running applications on Heroku apart the addition of the / at the very end. Without this properly fixed, application developers will have to implement workarounds within the code base of their projects.

@taylorotwell taylorotwell merged commit 4f87b37 into laravel:6.x Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants