diff options
author | Andreas Fischer <bantu@phpbb.com> | 2014-05-12 01:10:30 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2014-05-12 01:10:30 +0200 |
commit | bfacf2d6eb37372f2109a76a34b777e0af560a18 (patch) | |
tree | 8e9a32cbf4d91c91866095a50306f6dba47ac061 /phpBB | |
parent | 92e25398c72fe5b1766a6ad4e411aacc72bd177c (diff) | |
parent | 8d20f095aaa9e00f10a67022f0f0e84bf0a2b802 (diff) | |
download | forums-bfacf2d6eb37372f2109a76a34b777e0af560a18.tar forums-bfacf2d6eb37372f2109a76a34b777e0af560a18.tar.gz forums-bfacf2d6eb37372f2109a76a34b777e0af560a18.tar.bz2 forums-bfacf2d6eb37372f2109a76a34b777e0af560a18.tar.xz forums-bfacf2d6eb37372f2109a76a34b777e0af560a18.zip |
Merge pull request #2446 from nickvergessen/ticket/12518
[ticket/12518] Apply De Morgan to make the conditions easier reasable
* nickvergessen/ticket/12518:
[ticket/12518] Apply De Morgan to make the conditions easier to read
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/posting.php | 2 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 6e1bde42f8..441de9f28c 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -384,7 +384,7 @@ if ($mode == 'edit' && !$auth->acl_get('m_edit', $forum_id)) $force_edit_allowed = false; $s_cannot_edit = $user->data['user_id'] != $post_data['poster_id']; - $s_cannot_edit_time = !($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time']); + $s_cannot_edit_time = $config['edit_time'] && $post_data['post_time'] <= time() - ($config['edit_time'] * 60); $s_cannot_edit_locked = $post_data['post_edit_locked']; /** diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 56e4479973..95bee9789f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1585,7 +1585,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $force_edit_allowed = $force_delete_allowed = false; $s_cannot_edit = !$auth->acl_get('f_edit', $forum_id) || $user->data['user_id'] != $poster_id; - $s_cannot_edit_time = !($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time']); + $s_cannot_edit_time = $config['edit_time'] && $row['post_time'] <= time() - ($config['edit_time'] * 60); $s_cannot_edit_locked = $topic_data['topic_status'] == ITEM_LOCKED || $row['post_edit_locked']; $s_cannot_delete = $user->data['user_id'] != $poster_id || ( @@ -1593,7 +1593,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) (!$auth->acl_get('f_softdelete', $forum_id) || $row['post_visibility'] == ITEM_DELETED) ); $s_cannot_delete_lastpost = $topic_data['topic_last_post_id'] != $row['post_id']; - $s_cannot_delete_time = !($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']); + $s_cannot_delete_time = $config['delete_time'] && $row['post_time'] <= time() - ($config['delete_time'] * 60); // we do not want to allow removal of the last post if a moderator locked it! $s_cannot_delete_locked = $topic_data['topic_status'] == ITEM_LOCKED || $row['post_edit_locked']; |