From 96a4abe2a79f28993ece7daa2e966e89ae649aaa Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Fri, 11 Oct 2019 11:17:05 -0400 Subject: [PATCH] Bug 1580980 - Including "patch" in attachment description automatically flags the attachment as a patch --- js/attachment.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/attachment.js b/js/attachment.js index 414d6754a..de2f89089 100644 --- a/js/attachment.js +++ b/js/attachment.js @@ -698,8 +698,10 @@ Bugzilla.AttachmentForm = class AttachmentForm { * Called whenever the Description is updated. Update the Patch checkbox when needed. */ description_oninput() { - if (this.$description.value.match(/\bpatch\b/i) && !this.$ispatch.checked) { - this.update_ispatch(true); + const is_patch = !!this.$description.value.match(/^patch\b/i); + + if (is_patch !== this.$ispatch.checked) { + this.update_ispatch(is_patch); } } -- 2.47.3