Skip to content

Commit

Permalink
typecast first_post check ref #7
Browse files Browse the repository at this point in the history
  • Loading branch information
eeemarv committed Jan 17, 2019
1 parent f58e5ac commit d6e9f64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion event/listener.php
Expand Up @@ -78,6 +78,10 @@ public function posting_modify_template_vars(event $event)
$mode = $event['mode'];
$post_id = $event['post_id'];

error_log($post_id);
error_log($post_data['topic_first_post_id']);


if (!$this->is_first_post($mode, $post_id, $post_data['topic_first_post_id']))
{
return;
Expand All @@ -100,7 +104,7 @@ public function submit_post_modify_sql_data(event $event)

private function is_first_post(string $mode, int $post_id, $first_post_id):bool
{
if ($mode === 'edit' && $post_id !== $first_post_id)
if ($mode === 'edit' && $post_id !== (int) $first_post_id)
{
return false;
}
Expand Down

0 comments on commit d6e9f64

Please sign in to comment.