From bfda8851e27f802f41f4f6a9c82cff0c177c6112 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 11 Jun 2014 03:40:00 +0200 Subject: [PATCH 1/2] remove two extraneous fields from 4.5 to 5.0 migration --- install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.php b/install.php index 0addcef9..8096eff0 100644 --- a/install.php +++ b/install.php @@ -538,7 +538,7 @@ if (file_exists($config['has_installed'])) { foreach ($boards as &$board) { query(sprintf('ALTER TABLE ``posts_%s`` ADD `files` text DEFAULT NULL AFTER `bump`;', $board['uri'])) or error(db_error()); query(sprintf('ALTER TABLE ``posts_%s`` ADD `num_files` int(11) DEFAULT 0 AFTER `files`;', $board['uri'])) or error(db_error()); - query(sprintf('UPDATE ``posts_%s`` SET `files` = CONCAT(\'[{"file":"\',`file`,\'", "thumb":"\',`thumb`,\'", "filename":"\',`filename`,\'", "size":"\',`filesize`,\'", "width":"\',`filewidth`,\'","height":"\',`fileheight`,\'","thumbwidth":"\',`thumbwidth`,\'","thumbheight":"\',`thumbheight`,\'", "file_path":"%s\/src\/\',`filename`,\'","thumb_path":"%s\/thumb\/\',`filename`,\'"}]\') WHERE `file` IS NOT NULL', $board['uri'], $board['uri'], $board['uri'])) or error(db_error()); + query(sprintf('UPDATE ``posts_%s`` SET `files` = CONCAT(\'[{"file":"\',`file`,\'", "thumb":"\',`thumb`,\'", "filename":"\',`filename`,\'", "size":"\',`filesize`,\'", "width":"\',`filewidth`,\'","height":"\',`fileheight`,\'","thumbwidth":"\',`thumbwidth`,\'","thumbheight":"\',`thumbheight`,\'"}]\') WHERE `file` IS NOT NULL', $board['uri'], $board['uri'], $board['uri'])) or error(db_error()); query(sprintf('UPDATE ``posts_%s`` SET `num_files` = 1 WHERE `file` IS NOT NULL', $board['uri'])) or error(db_error()); query(sprintf('ALTER TABLE ``posts_%s`` DROP COLUMN `thumb`, DROP COLUMN `thumbwidth`, DROP COLUMN `thumbheight`, DROP COLUMN `file`, DROP COLUMN `fileheight`, DROP COLUMN `filesize`, DROP COLUMN `filewidth`, DROP COLUMN `filename`', $board['uri'])) or error(db_error()); query(sprintf('REPAIR TABLE ``posts_%s``', $board['uri'])); From 2c5ae29a3bb532fdc676942db0e7444f7402af44 Mon Sep 17 00:00:00 2001 From: Chen-Pang He Date: Wed, 11 Jun 2014 12:07:45 +0800 Subject: [PATCH 2/2] Fix vichan #65 Conflicts: inc/mod/auth.php inc/mod/pages.php --- inc/mod/auth.php | 4 ++-- inc/mod/pages.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/mod/auth.php b/inc/mod/auth.php index 182f3ee2..01ed5b68 100644 --- a/inc/mod/auth.php +++ b/inc/mod/auth.php @@ -69,13 +69,13 @@ function setCookies() { $mod['hash'][0] . // password ':' . $mod['hash'][1], // salt - time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'], $config['cookies']['httponly']); + time() + $config['cookies']['expire'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off', $config['cookies']['httponly']); } function destroyCookies() { global $config; // Delete the cookies - setcookie($config['cookies']['mod'], 'deleted', time() - $config['cookies']['expire'], $config['cookies']['jail']?$config['cookies']['path'] : '/', null, isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'], true); + setcookie($config['cookies']['mod'], 'deleted', time() - $config['cookies']['expire'], $config['cookies']['jail']?$config['cookies']['path'] : '/', null, !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off', true); } function modLog($action, $_board=null) { diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 0af16a9c..05a24865 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -150,7 +150,7 @@ function mod_dashboard() { $latest = false; } - setcookie('update', serialize($latest), time() + $config['check_updates_time'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'], true); + setcookie('update', serialize($latest), time() + $config['check_updates_time'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off', true); } if ($latest)