sqlite3 returns integers as ints

This commit is contained in:
Latif Khalifa
2013-09-22 23:42:39 +02:00
parent b7f32bc5ee
commit 8d239c6fd1
2 changed files with 9 additions and 2 deletions

View File

@@ -112,7 +112,7 @@ function update_builds()
$version = "$major.$minor.$maintenance.$build";
$res = $DB->query(kl_str_sql("select count(*) as c from builds where nr=!i and chan=!s", $build, $chan));
$row = $DB->fetchRow($res);
if ($row["c"] === "0") {
if ($row["c"] == 0) {
$DB->query(kl_str_sql("insert into builds (nr, chan, version, file, modified) ".
"values (!i, !s, !s, !s, !t)",
$build, $chan, $version, $file, $modified));
@@ -174,7 +174,7 @@ function add_build($build, $chan, $version, $hash)
$res = $DB->query(kl_str_sql("select count(*) as c from builds where nr=!i and chan=!s", $build, $chan));
$row = $DB->fetchRow($res);
if ($row["c"] === "0") {
if ($row["c"] == 0) {
$DB->query(kl_str_sql("insert into builds (nr, chan, version, hash, modified) ".
"values (!i, !s, !s, !s, !t)",
$build, $chan, $version, $hash, time() - date("Z")));

View File

@@ -82,6 +82,13 @@ if (!$DB->connect($DB_NAME, $DB_HOST, $DB_USER, $DB_PASS)) {
*/
/*
if (PHP_SAPI != "cli") {
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 600));
header('Cache-Control: max-age=' . (4 * 3600));
}
*/
/* Prevent XSS attacks via PHP_SELF */
$_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);