if ($userGroup[$loginArr['group']]['reply'] == 0) { die("0 " . $userGroup[$loginArr['group']]['name'] . "不能回复帖子"); } $postTime = time(); if (isset($_COOKIE['lastPostTime']) && $postTime - $_COOKIE['lastPostTime'] < 10) { die("0 您的回帖速度太快了!"); } if (isset($_POST['tid'], $_POST['fid'], $_POST['title'], $_POST['content'])) { $topicId = intval($_POST['tid']); $forumId = intval($_POST['fid']); $floorId = intval(preg_replace("/回复(\\d+):(.*)/is", "\\1", $_POST['title'])); if ($floorId < 1) { $floorId = 1; } $content = filterCode(htmlToUBB($_POST['content']), false); $checkContent = checkPostContent($content); if ($checkContent != "") { die("0 " . $checkContent); } $DB->connect($mysql_host, $mysql_user, $mysql_pass, $mysql_dbname); $forumArr = $DB->fetch_one_array("SELECT `fid`,`moderator` FROM `" . $table_forum . "` WHERE `fid`=" . $forumId); if (empty($forumArr['fid'])) { $DB->close(); die("0 该吧不存在或者已被删除"); } if ($DB->fetch_one("SELECT `lockout` FROM `" . $table_topic . "` WHERE `tid`=" . $topicId) != 0) { $DB->close(); die("0 该主题已被锁定,禁止回复!"); } $postTotal = $DB->fetch_one("SELECT COUNT(`pid`) FROM `" . $table_post . "` WHERE `tid`=" . $topicId); if ($postTotal < 1 || $floorId > $postTotal) {
<?php /** * Routing Definitions */ require __DIR__ . '/middleware.php'; $controller = new \MiniFace\Controller\MainController($app); $factory = $controller->connect($app)->before(checkPostContent()); $app->mount('', $factory);