Skip to content

Commit

Permalink
Don't leak private information #26
Browse files Browse the repository at this point in the history
infojunkie committed Feb 11, 2017
1 parent 740621b commit 91b9682
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Slack.php
Original file line number Diff line number Diff line change
@@ -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);

1 comment on commit 91b9682

@ennorehling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good, thanks!

Please sign in to comment.