]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/DB.php
setup: escape arguments when executing shell commands (psql, createdb)
[nominatim.git] / lib / DB.php
index 51fd49fc228329c87e0055a0741d529f20bb1aa2..ddc0932c871e123214e3d373b7a33e9abcaa193a 100644 (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';