diff options
| author | czaks <marcin@6irc.net> | 2013-09-17 19:12:19 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-09-17 19:12:19 -0400 |
| commit | 8ca495e5b8c8382dbfeebc4990f0accc80101a46 (patch) | |
| tree | f0fec3bb1fb9abdb81ce1e89c678b4b2e62b874e /inc/mod/pages.php | |
| parent | 9516aa199730115014538314dd46a5eaf3b12d20 (diff) | |
| parent | 840e8cd0936ad9577a6cecf56120716af77bdf6a (diff) | |
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard into vichan-devel-4.5
Conflicts:
inc/config.php
Diffstat (limited to 'inc/mod/pages.php')
| -rw-r--r-- | inc/mod/pages.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 5166a348..3d1fd41a 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1275,7 +1275,8 @@ function mod_ban_post($board, $delete, $post, $token = false) { $security_token = make_secure_link_token($board . '/ban/' . $post); - $query = prepare(sprintf('SELECT `ip`, `thread` FROM ``posts_%s`` WHERE `id` = :id', $board)); + $query = prepare(sprintf('SELECT ' . ($config['ban_show_post'] ? '*' : '`ip`, `thread`') . + ' FROM ``posts_%s`` WHERE `id` = :id', $board)); $query->bindValue(':id', $post); $query->execute() or error(db_error($query)); if (!$_post = $query->fetch(PDO::FETCH_ASSOC)) @@ -1290,11 +1291,12 @@ function mod_ban_post($board, $delete, $post, $token = false) { if (isset($_POST['ip'])) $ip = $_POST['ip']; - Bans::new_ban($_POST['ip'], $_POST['reason'], $_POST['length'], $_POST['board'] == '*' ? false : $_POST['board']); + Bans::new_ban($_POST['ip'], $_POST['reason'], $_POST['length'], $_POST['board'] == '*' ? false : $_POST['board'], + false, $config['ban_show_post'] ? $_post : false); if (isset($_POST['public_message'], $_POST['message'])) { // public ban message - $length_english = parse_time($_POST['length']) ? 'for ' . until(parse_time($_POST['length'])) : 'permanently'; + $length_english = Bans::parse_time($_POST['length']) ? 'for ' . until(Bans::parse_time($_POST['length'])) : 'permanently'; $_POST['message'] = preg_replace('/[\r\n]/', '', $_POST['message']); $_POST['message'] = str_replace('%length%', $length_english, $_POST['message']); $_POST['message'] = str_replace('%LENGTH%', strtoupper($length_english), $_POST['message']); |
