Skip to content

Commit

Permalink
Only allow querystring arguments to be processed as NULL, TRUE, and F…
Browse files Browse the repository at this point in the history
…ALSE constants
  • Loading branch information
josegonzalez committed Oct 13, 2014
1 parent 9b7044a commit acceb13
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Core/StaticConfigTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ public static function parseDsn($config = null) {

parse_str($query, $queryArgs);

foreach ($queryArgs as $key => $value) {
if ($value === 'true') {
$queryArgs[$key] = true;
} elseif ($value === 'false') {
$queryArgs[$key] = false;
} elseif ($value === 'null') {
$queryArgs[$key] = null;
}
}

if (isset($parsed['user'])) {
$parsed['username'] = $parsed['user'];
}
Expand All @@ -218,16 +228,6 @@ public static function parseDsn($config = null) {
}
}

foreach ($config as $key => $value) {
if ($value === 'true') {
$config[$key] = true;
} elseif ($value === 'false') {
$config[$key] = false;
} elseif ($value === 'null') {
$config[$key] = null;
}
}

return $config;
}

Expand Down

0 comments on commit acceb13

Please sign in to comment.