diff options
| author | czaks <marcin@6irc.net> | 2014-06-20 23:27:34 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-06-20 23:27:34 +0200 |
| commit | 73177fcffc040d1c225782fe85f09576a39f6890 (patch) | |
| tree | b101f49b4ff3b2b00d20b874abd702bb04ea6220 /post.php | |
| parent | 9e2b722db6784226b1394ddf957aa9a4a16ac9a9 (diff) | |
| parent | 7933abd271b5bb3578cd80f62302cc6ac8961b91 (diff) | |
Merge branch '4.5' of github.com:vichan-devel/Tinyboard into HEAD
Conflicts:
templates/themes/basic/index.html
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -52,10 +52,19 @@ if (isset($_POST['delete'])) { $query->execute() or error(db_error($query)); if ($post = $query->fetch(PDO::FETCH_ASSOC)) { - if ($password != '' && $post['password'] != $password) + $thread = false; + if ($config['user_moderation'] && $post['thread']) { + $thread_query = prepare(sprintf("SELECT `time`,`password` FROM ``posts_%s`` WHERE `id` = :id", $board['uri'])); + $thread_query->bindValue(':id', $post['thread'], PDO::PARAM_INT); + $thread_query->execute() or error(db_error($query)); + + $thread = $thread_query->fetch(PDO::FETCH_ASSOC); + } + + if ($password != '' && $post['password'] != $password && (!$thread || $thread['password'] != $password)) error($config['error']['invalidpassword']); - if ($post['time'] > time() - $config['delete_time']) { + if ($post['time'] > time() - $config['delete_time'] && (!$thread || $thread['password'] != $password)) { error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time']))); } @@ -632,7 +641,7 @@ if (isset($_POST['delete'])) { if (!$config['redraw_image'] && $config['use_exiftool']) { if($error = shell_exec_error('exiftool -overwrite_original -ignoreMinorErrors -q -q -all= ' . escapeshellarg($upload))) - error('Could not strip EXIF metadata!', null, $error); + error(_('Could not strip EXIF metadata!'), null, $error); } else { $image->to($post['file']); $dont_copy_file = true; |
