diff --git a/inc/lib/Twig/Extensions/Extension/Tinyboard.php b/inc/lib/Twig/Extensions/Extension/Tinyboard.php index 986ecf45..81276147 100644 --- a/inc/lib/Twig/Extensions/Extension/Tinyboard.php +++ b/inc/lib/Twig/Extensions/Extension/Tinyboard.php @@ -92,7 +92,7 @@ function twig_sprintf_filter( $value, $var) { return sprintf($value, $var); } -function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') { +function twig_truncate_filter($value, $length = 30, $preserve = false, $separator = '…') { if (mb_strlen($value) > $length) { if ($preserve) { if (false !== ($breakpoint = mb_strpos($value, ' ', $length))) { @@ -104,7 +104,7 @@ function twig_truncate_filter($value, $length = 30, $preserve = false, $separato return $value; } -function twig_filename_truncate_filter($value, $length = 30, $separator = '…') { +function twig_filename_truncate_filter($value, $length = 30, $separator = '…') { if (mb_strlen($value) > $length) { $value = strrev($value); $array = array_reverse(explode(".", $value, 2)); diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 8402ba50..dd6622bd 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -244,7 +244,7 @@ function mod_search($type, $search_query_escaped, $page_no = 1) { // Which `field` to search? if ($type == 'posts') - $sql_field = array('body_nomarkup', 'filename', 'file', 'subject', 'filehash', 'ip', 'name', 'trip'); + $sql_field = array('body_nomarkup', 'files', 'subject', 'filehash', 'ip', 'name', 'trip'); if ($type == 'IP_notes') $sql_field = 'body'; if ($type == 'bans') diff --git a/install.php b/install.php index 98c5a7ed..db2e7885 100644 --- a/install.php +++ b/install.php @@ -1,7 +1,7 @@ You are upgrading to the 5.0 branch of vichan. Please back up your database, because the process is irreversible. At the current time, if you want a very stable vichan experience, please use the 4.5 branch. This warning will be lifted as soon as we all agree that 5.0 branch is stable enough

@@ -531,7 +532,7 @@ if (file_exists($config['has_installed'])) { I have read and understood the warning. Proceed to upgrading.

'; - file_write($config['has_installed'], '4.5.1'); + file_write($config['has_installed'], '4.5.2'); break; } @@ -544,6 +545,7 @@ if (file_exists($config['has_installed'])) { 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'])); } + case '4.9.90': case false: // TODO: enhance Tinyboard -> vichan upgrade path. query("CREATE TABLE IF NOT EXISTS ``search_queries`` ( `ip` varchar(39) NOT NULL, `time` int(11) NOT NULL, `query` text NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;") or error(db_error());