X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5a5b3de79af2a3ffd37853ec66cedc454d11a2a3..000fe3ddffc591d28179daf166c63cf90a7d0472:/lib/DB.php diff --git a/lib/DB.php b/lib/DB.php index 51fd49fc..e4aa4349 100644 --- a/lib/DB.php +++ b/lib/DB.php @@ -135,7 +135,7 @@ class DB try { $stmt = $this->getQueryStatement($sSQL, $aInputVars, $sErrMessage); - while ($val = $stmt->fetchColumn(0)) { // returns first column or false + while (($val = $stmt->fetchColumn(0)) !== false) { // returns first column or false $aVals[] = $val; } } catch (\PDOException $e) { @@ -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';