setup: escape arguments when executing shell commands (psql, createdb)

This commit is contained in:
marc tobias
2019-11-05 23:50:46 +01:00
parent 5e45e0b3d7
commit 9cfd891fb9
3 changed files with 41 additions and 30 deletions

View File

@@ -284,7 +284,7 @@ class DB
{
// https://secure.php.net/manual/en/ref.pdo-pgsql.connection.php
$aInfo = array();
if (preg_match('/^pgsql:(.+)/', $sDSN, $aMatches)) {
if (preg_match('/^pgsql:(.+)$/', $sDSN, $aMatches)) {
foreach (explode(';', $aMatches[1]) as $sKeyVal) {
list($sKey, $sVal) = explode('=', $sKeyVal, 2);
if ($sKey == 'host') $sKey = 'hostspec';