1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-24 07:30:10 +01:00

tinyboard special markup: allow content to span multiple lines

This commit is contained in:
czaks 2013-08-05 05:02:37 -04:00
parent b438fb294b
commit 6267876758

View File

@ -1049,7 +1049,7 @@ function index($page, $mod=false) {
$thread = new Thread(
$th['id'], $th['subject'], $th['email'], $th['name'], $th['trip'], $th['capcode'], $th['body'], $th['time'], $th['thumb'],
$th['thumbwidth'], $th['thumbheight'], $th['file'], $th['filewidth'], $th['fileheight'], $th['filesize'], $th['filename'], $th['ip'],
$th['sticky'], $th['locked'], $th['sage'], $th['embed'], $mod ? '?/' : $config['root'], $mod
$th['sticky'], $th['locked'], $th['sage'], $th['embed'], $mod ? '?/' : $config['root'], $mod, true, $th['password']
);
if ($config['cache']['enabled'] && $cached = cache::get("thread_index_{$board['uri']}_{$th['id']}")) {
@ -1085,7 +1085,7 @@ function index($page, $mod=false) {
$thread->add(new Post(
$po['id'], $th['id'], $po['subject'], $po['email'], $po['name'], $po['trip'], $po['capcode'], $po['body'], $po['time'],
$po['thumb'], $po['thumbwidth'], $po['thumbheight'], $po['file'], $po['filewidth'], $po['fileheight'], $po['filesize'],
$po['filename'], $po['ip'], $po['embed'], $mod ? '?/' : $config['root'], $mod)
$po['filename'], $po['ip'], $po['embed'], $mod ? '?/' : $config['root'], $mod, $po['password'])
);
}
@ -1495,7 +1495,7 @@ function markup(&$body, $track_cites = false) {
$body = str_replace("\r", '', $body);
$body = utf8tohtml($body);
if (preg_match_all('@<tinyboard ([\w\s]+)>(.+?)</tinyboard>@um', $body, $modifiers, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
if (preg_match_all('@<tinyboard ([\w\s]+)>(.+?)</tinyboard>@us', $body, $modifiers, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
$skip_chars = 0;
$body_tmp = $body;
$end_markup = false;
@ -1624,6 +1624,7 @@ function markup(&$body, $track_cites = false) {
foreach ($cites as $matches) {
$_board = $matches[2][0];
echo $_board;
$cite = @$matches[3][0];
// preg_match_all is not multibyte-safe
@ -1755,13 +1756,13 @@ function buildThread($id, $return = false, $mod = false) {
$thread = new Thread(
$post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['capcode'], $post['body'], $post['time'],
$post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'],
$post['filename'], $post['ip'], $post['sticky'], $post['locked'], $post['sage'], $post['embed'], $mod ? '?/' : $config['root'], $mod
$post['filename'], $post['ip'], $post['sticky'], $post['locked'], $post['sage'], $post['embed'], $mod ? '?/' : $config['root'], $mod, true, $post['password']
);
} else {
$thread->add(new Post(
$post['id'], $thread->id, $post['subject'], $post['email'], $post['name'], $post['trip'], $post['capcode'], $post['body'],
$post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'],
$post['filesize'], $post['filename'], $post['ip'], $post['embed'], $mod ? '?/' : $config['root'], $mod)
$post['filesize'], $post['filename'], $post['ip'], $post['embed'], $mod ? '?/' : $config['root'], $mod, $post['password'])
);
}
}
@ -1933,7 +1934,7 @@ function rDNS($ip_addr) {
}
if (!$config['dns_system']) {
$host = gethostbyaddr($ip_addr);
$host = @gethostbyaddr($ip_addr);
} else {
$resp = shell_exec_error('host -W 1 ' . $ip_addr);
if (preg_match('/domain name pointer ([^\s]+)$/', $resp, $m))