Skip to content

Commit

Permalink
If the value of dsn fails to be parsed, return the original config …
Browse files Browse the repository at this point in the history
…as is.

Malformed DSNs may result in false being returned from `parse_url`, breaking further logic. As we do merges of the original config and the parsed DSN arrays, the logic is short-circuited to provide a similar pathway.
  • Loading branch information
josegonzalez committed Oct 13, 2014
1 parent 953b72c commit 9629148
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/StaticConfigTrait.php
Expand Up @@ -184,6 +184,11 @@ public static function parseDsn($config = null) {
}

$parsed = parse_url($dsn);

if ($parsed === false) {
return $config;
}

$query = '';

if (isset($parsed['query'])) {
Expand Down

0 comments on commit 9629148

Please sign in to comment.