mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-01-31 20:17:11 +00:00
block mysql versions where true is undefined in sanity_check
This commit is contained in:
10
db.php
10
db.php
@@ -55,19 +55,23 @@ function db_escape_string_2($s, $link) {
|
||||
}
|
||||
}
|
||||
|
||||
function db_query($link, $query) {
|
||||
function db_query($link, $query, $die_on_error = true) {
|
||||
if (DB_TYPE == "pgsql") {
|
||||
$result = pg_query($link, $query);
|
||||
if (!$result) {
|
||||
$query = htmlspecialchars($query); // just in case
|
||||
die("Query <i>$query</i> failed: " . pg_last_error($link));
|
||||
if ($die_on_error) {
|
||||
die("Query <i>$query</i> failed: " . pg_last_error($link));
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
} else if (DB_TYPE == "mysql") {
|
||||
$result = mysql_query($query, $link);
|
||||
if (!$result) {
|
||||
$query = htmlspecialchars($query);
|
||||
die("Query <i>$query</i> failed: " . mysql_error($link));
|
||||
if ($die_on_error) {
|
||||
die("Query <i>$query</i> failed: " . mysql_error($link));
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user