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

[5.3] Added check for empty port to prevent Invalid Handler Error #16824

Merged
merged 2 commits into from
Dec 16, 2016
Merged

[5.3] Added check for empty port to prevent Invalid Handler Error #16824

merged 2 commits into from
Dec 16, 2016

Conversation

kharysharpe
Copy link
Contributor

Prevents DSN from generating with an extra comma and throwing an Invalid Handler Error when port is specified in the database configuration but not set to a value.

Produces 'sqlsrv:Server=localhost;Database=mydb;' instead of 'sqlsrv:Server=localhost,;Database=mydb;'

Prevents DSN from generating with an extra comma and throwing an Invalid Handler Error when port is specified in the database configuration but not set to a value.

Produces 'sqlsrv:Server=localhost;Database=mydb;' instead of 'sqlsrv:Server=localhost,;Database=mydb;'
@kharysharpe kharysharpe changed the base branch from 5.3 to master December 16, 2016 06:55
@GrahamCampbell GrahamCampbell changed the title Added check for empty port to prevent Invalid Handler Error [5.3] Added check for empty port to prevent Invalid Handler Error Dec 16, 2016
@GrahamCampbell GrahamCampbell changed the base branch from master to 5.3 December 16, 2016 11:21
@taylorotwell taylorotwell merged commit ad52170 into laravel:5.3 Dec 16, 2016
@@ -155,7 +155,7 @@ protected function buildConnectString($driver, array $arguments)
*/
protected function buildHostString(array $config, $separator)
{
if (isset($config['port'])) {
if (isset($config['port']) && ! empty($config['port'])) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be shortened to simply if (! empty($config['port']))

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.

3 participants