From 1f78084a13595b7d2db490c4ecaff77d343a3bfb Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 30 Mar 2015 22:38:13 +0200 Subject: [PATCH] Use true boolean values for failed_downloads table. Fix __construct usage in page.php. (cherry picked from commit 11d81d02cb2dc34ff632aa533af74e95bba9d868) --- lib/copy_this/www/lib/page.php | 2 +- lib/copy_this/www/lib/releases.php | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/copy_this/www/lib/page.php b/lib/copy_this/www/lib/page.php index d56873ada..68b06ea5e 100644 --- a/lib/copy_this/www/lib/page.php +++ b/lib/copy_this/www/lib/page.php @@ -16,7 +16,7 @@ class Page extends BasePage */ public function __construct() { - parent::BasePage(); + parent::__construct(); $role=Users::ROLE_GUEST; if ($this->userdata != null) diff --git a/lib/copy_this/www/lib/releases.php b/lib/copy_this/www/lib/releases.php index 39a064922..458df9a29 100644 --- a/lib/copy_this/www/lib/releases.php +++ b/lib/copy_this/www/lib/releases.php @@ -2988,16 +2988,15 @@ class Releases public function getAlternate($guid, $searchname, $userid, $failed = true) { //status values - // 0 = default value - // 1 = failed - // 2 = success + // 0/false = successfully downloaded + // 1/true = failed download $this->pdo->queryInsert(sprintf("INSERT INTO failed_downloads (guid, userid, status) VALUES (%s, %d, %d) ON DUPLICATE KEY UPDATE status = %d", $this->pdo->escapeString($guid), $userid, - ($failed === true ? 1 : 2), - ($failed === true ? 1 : 2) + ($failed === true ? true : false), + ($failed === true ? true : false) ) );