From 91b968210e9131d5ce003de71ad52ff91befa2c8 Mon Sep 17 00:00:00 2001 From: infojunkie Date: Sun, 12 Feb 2017 00:19:11 +0200 Subject: [PATCH] Don't leak private information #26 --- Slack.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Slack.php b/Slack.php index 16c416c..2e4503e 100644 --- a/Slack.php +++ b/Slack.php @@ -93,7 +93,7 @@ function bugnote_add_form($event, $bug_id) { } function bug_report_update($event, $bug, $bug_id) { - $this->skip = $this->skip || gpc_get_bool('slack_skip'); + $this->skip = $this->skip || gpc_get_bool('slack_skip') || $bug->view_state == VS_PRIVATE; $project = project_get_name($bug->project_id); $url = string_get_bug_view_url_with_fqdn($bug_id); @@ -123,9 +123,10 @@ function bug_action($event, $action, $bug_id) { } function bug_deleted($event, $bug_id) { - $this->skip = $this->skip || gpc_get_bool('slack_skip'); - $bug = bug_get($bug_id); + + $this->skip = $this->skip || gpc_get_bool('slack_skip') || $bug->view_state == VS_PRIVATE; + $project = project_get_name($bug->project_id); $reporter = '@' . user_get_name(auth_get_current_user_id()); $summary = $this->format_summary($bug); @@ -134,9 +135,11 @@ function bug_deleted($event, $bug_id) { } function bugnote_add_edit($event, $bug_id, $bugnote_id) { - $this->skip = $this->skip || gpc_get_bool('slack_skip'); - $bug = bug_get($bug_id); + $bugnote = bugnote_get($bugnote_id); + + $this->skip = $this->skip || gpc_get_bool('slack_skip') || $bug->view_state == VS_PRIVATE || $bugnote->view_state == VS_PRIVATE; + $url = string_get_bugnote_view_url_with_fqdn($bug_id, $bugnote_id); $project = project_get_name($bug->project_id); $summary = $this->format_summary($bug); @@ -149,9 +152,11 @@ function bugnote_add_edit($event, $bug_id, $bugnote_id) { } function bugnote_deleted($event, $bug_id, $bugnote_id) { - $this->skip = $this->skip || gpc_get_bool('slack_skip'); - $bug = bug_get($bug_id); + $bugnote = bugnote_get($bugnote_id); + + $this->skip = $this->skip || gpc_get_bool('slack_skip') || $bug->view_state == VS_PRIVATE || $bugnote->view_state == VS_PRIVATE; + $project = project_get_name($bug->project_id); $url = string_get_bug_view_url_with_fqdn($bug_id); $summary = $this->format_summary($bug);