mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-30 18:24:29 +01:00
increase character limit on board URI, title and subtitle
This commit is contained in:
parent
874b8cbf00
commit
033491f84f
@ -122,7 +122,7 @@
|
||||
$body = html_entity_decode($body, ENT_COMPAT, 'UTF-8');
|
||||
|
||||
// calculate strlen() so we can add "..." after if needed
|
||||
$strlen = strlen($body);
|
||||
$strlen = mb_strlen($body);
|
||||
|
||||
$body = substr($body, 0, $len);
|
||||
|
||||
|
@ -213,17 +213,17 @@
|
||||
'<table>' .
|
||||
'<tr>' .
|
||||
'<th><label for="board">URI</label></th>' .
|
||||
'<td><input type="text" name="uri" id="board" size="10" maxlength="15" />' .
|
||||
'<td><input type="text" name="uri" id="board" size="10" />' .
|
||||
' <span class="unimportant">(eg. "b"; "mu")</span></td>' .
|
||||
'</tr>' .
|
||||
'<tr>' .
|
||||
'<th><label for="title">Title</label></th>' .
|
||||
'<td><input type="text" name="title" id="title" size="25" maxlength="40" />' .
|
||||
'<td><input type="text" name="title" id="title" size="25" />' .
|
||||
' <span class="unimportant">(eg. "Random")</span></td>' .
|
||||
'</tr>' .
|
||||
'<tr>' .
|
||||
'<th><label for="subtitle">Subtitle</label></th>' .
|
||||
'<td><input type="text" name="subtitle" id="subtitle" size="25" maxlength="120" />' .
|
||||
'<td><input type="text" name="subtitle" id="subtitle" size="25" />' .
|
||||
' <span class="unimportant">(optional)</span></td>' .
|
||||
'</tr>' .
|
||||
'<tr>' .
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
// Installation/upgrade file
|
||||
define('VERSION', 'v0.9.5');
|
||||
define('VERSION', 'v0.9.6-dev-1');
|
||||
|
||||
require 'inc/functions.php';
|
||||
require 'inc/display.php';
|
||||
@ -168,9 +168,14 @@
|
||||
query("ALTER TABLE `boards`
|
||||
CHANGE `uri` `uri` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
CHANGE `title` `title` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
CHANGE `subtitle` `subtitle` VARCHAR( 120 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL");
|
||||
CHANGE `subtitle` `subtitle` VARCHAR( 120 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL") or error(db_error());
|
||||
case 'v0.9.5-dev-3':
|
||||
// v0.9.5
|
||||
case 'v0.9.5':
|
||||
query("ALTER TABLE `boards`
|
||||
CHANGE `uri` `uri` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
CHANGE `title` `title` TINYTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
CHANGE `subtitle` `subtitle` TINYTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL") or error(db_error());
|
||||
case false:
|
||||
// Update version number
|
||||
file_write($config['has_installed'], VERSION);
|
||||
|
@ -46,9 +46,9 @@ CREATE TABLE IF NOT EXISTS `bans` (
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `boards` (
|
||||
`id` smallint(6) NOT NULL AUTO_INCREMENT,
|
||||
`uri` varchar(15) NOT NULL,
|
||||
`title` varchar(40) NOT NULL,
|
||||
`subtitle` varchar(120) DEFAULT NULL,
|
||||
`uri` varchar(50) NOT NULL,
|
||||
`title` TINYTEXT NOT NULL,
|
||||
`subtitle` TINYTEXT DEFAULT NULL,
|
||||
PRIMARY KEY (`uri`),
|
||||
UNIQUE KEY `id` (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
|
||||
|
12
mod.php
12
mod.php
@ -1743,8 +1743,8 @@
|
||||
'<table>' .
|
||||
|
||||
'<tr><th>URI</th><td>' . $board['uri'] . '</td>' .
|
||||
'<tr><th>Title</th><td><input size="20" maxlength="20" type="text" name="title" value="' . $board['name'] . '" /></td></tr>' .
|
||||
'<tr><th>Subtitle</th><td><input size="20" maxlength="40" type="text" name="subtitle" value="' .
|
||||
'<tr><th>Title</th><td><input size="20" type="text" name="title" value="' . $board['name'] . '" /></td></tr>' .
|
||||
'<tr><th>Subtitle</th><td><input size="20" type="text" name="subtitle" value="' .
|
||||
(isset($board['title']) ? $board['title'] : '') . '" /></td></tr>' .
|
||||
|
||||
'</table>' .
|
||||
@ -2140,14 +2140,6 @@
|
||||
if(empty($b['title']))
|
||||
error(sprintf($config['error']['required'], 'title'));
|
||||
|
||||
// Check string lengths
|
||||
if(mb_strlen($b['uri']) > 15)
|
||||
error(sprintf($config['error']['toolong'], 'URI'));
|
||||
if(strlen($b['title']) > 40)
|
||||
error(sprintf($config['error']['toolong'], 'title'));
|
||||
if(strlen($b['subtitle']) > 120)
|
||||
error(sprintf($config['error']['toolong'], 'subtitle'));
|
||||
|
||||
if(!preg_match('/^\w+$/', $b['uri']))
|
||||
error(sprintf($config['error']['invalidfield'], 'URI'));
|
||||
|
||||
|
15
post.php
15
post.php
@ -18,9 +18,7 @@
|
||||
if(isset($_POST['delete'])) {
|
||||
// Delete
|
||||
|
||||
if( !isset($_POST['board']) ||
|
||||
!isset($_POST['password'])
|
||||
)
|
||||
if(!isset($_POST['board'], $_POST['password']))
|
||||
error($config['error']['bot']);
|
||||
|
||||
$password = &$_POST['password'];
|
||||
@ -82,10 +80,7 @@
|
||||
header('Location: ' . $root . $board['dir'] . $config['file_index'], true, $config['redirect_http']);
|
||||
|
||||
} elseif(isset($_POST['report'])) {
|
||||
if( !isset($_POST['board']) ||
|
||||
!isset($_POST['password']) ||
|
||||
!isset($_POST['reason'])
|
||||
)
|
||||
if(!isset($_POST['board'], $_POST['password'], $_POST['reason']))
|
||||
error($config['error']['bot']);
|
||||
|
||||
$report = Array();
|
||||
@ -142,10 +137,8 @@
|
||||
header('Location: ' . $root . $board['dir'] . $config['file_index'], true, $config['redirect_http']);
|
||||
} elseif(isset($_POST['post'])) {
|
||||
|
||||
if( !isset($_POST['subject']) ||
|
||||
!isset($_POST['body']) ||
|
||||
!isset($_POST['board'])
|
||||
) error($config['error']['bot']);
|
||||
if(!isset($_POST['subject'], $_POST['body'], $_POST['board']))
|
||||
error($config['error']['bot']);
|
||||
|
||||
if(!isset($_POST['name']))
|
||||
$_POST['name'] = $config['anonymous'];
|
||||
|
Loading…
Reference in New Issue
Block a user