$size = 0; if ($config['multiimage_method'] == 'split') { foreach ($_FILES as $key => $file) { $size += $file['size']; } } elseif ($config['multiimage_method'] == 'each') { foreach ($_FILES as $key => $file) { if ($file['size'] > $size) { $size = $file['size']; } } } else { error(_('Unrecognized file size determination method.')); } if ($size > $config['max_filesize']) { error(sprintf3($config['error']['filesize'], array('sz' => number_format($size), 'filesz' => number_format($size), 'maxsz' => number_format($config['max_filesize'])))); } $post['filesize'] = $size; } $post['capcode'] = false; if ($mod && preg_match('/^((.+) )?## (.+)$/', $post['name'], $matches) && (in_array($board['uri'], $mod['boards']) or $mod['boards'][0] == '*')) { $name = $matches[2] != '' ? $matches[2] : $config['anonymous']; $cap = $matches[3]; if (isset($config['mod']['capcode'][$mod['type']])) { if ($config['mod']['capcode'][$mod['type']] === true || is_array($config['mod']['capcode'][$mod['type']]) && in_array($cap, $config['mod']['capcode'][$mod['type']])) { $post['capcode'] = utf8tohtml($cap); $post['name'] = $name; } } } $trip = generate_tripcode($post['name']);
$stripped_whitespace = preg_replace('/[\\s]/u', '', $post['body']); if ($stripped_whitespace == '') { error($config['error']['tooshort_body']); } } // Check if thread is locked // but allow mods to post if (!$OP && !hasPermission($config['mod']['postinlocked'], $board['uri'])) { if ($thread['locked']) { error($config['error']['locked']); } } if ($post['has_file']) { $size = $_FILES['file']['size']; if ($size > $config['max_filesize']) { error(sprintf3($config['error']['filesize'], array('sz' => commaize($size), 'filesz' => commaize($size), 'maxsz' => commaize($config['max_filesize'])))); } } if ($mod && $mod['type'] >= MOD && preg_match('/^((.+) )?## (.+)$/', $post['name'], $match)) { if ($mod['type'] == MOD && $match[3] == 'Mod' || $mod['type'] >= ADMIN) { $post['capcode'] = utf8tohtml($match[3]); $post['name'] = $match[2] != '' ? $match[2] : $config['anonymous']; } } else { $post['capcode'] = false; } $trip = generate_tripcode($post['name']); $post['name'] = $trip[0]; $post['trip'] = isset($trip[1]) ? $trip[1] : ''; if (strtolower($post['email']) == 'noko') { $noko = true;