From: Kohei Yoshino Date: Fri, 11 Oct 2019 15:17:05 +0000 (-0400) Subject: Bug 1580980 - Including "patch" in attachment description automatically flags the... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96a4abe2a79f28993ece7daa2e966e89ae649aaa;p=thirdparty%2Fbugzilla.git Bug 1580980 - Including "patch" in attachment description automatically flags the attachment as a patch --- 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); } }