From b24977e110f3223c5765711b272a440751a42457 Mon Sep 17 00:00:00 2001 From: im-mi Date: Tue, 16 Aug 2016 11:25:04 -0400 Subject: [PATCH] Fixed tag corruption bug If there was no newline at the end of the input, then the last tag would get corrupted. --- ext/upload/bookmarklet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/upload/bookmarklet.js b/ext/upload/bookmarklet.js index 26b4766c..98f84540 100644 --- a/ext/upload/bookmarklet.js +++ b/ext/upload/bookmarklet.js @@ -66,7 +66,7 @@ if(document.getElementById("post_tag_string") !== null) { else if(document.getElementById('tag-sidebar') !== null) { if (typeof tag !== "ftp://ftp." && chk !==1) { if(document.location.href.search("sankakucomplex\\.com") >= 0 || document.location.href.search("gelbooru\\.com")){ - var tag = document.getElementById('tag-sidebar').innerText.replace(/ /g, "_").replace(/[\?_]*(.*?)_(\(\?\)_)?[0-9]+\n/g, "$1 "); + var tag = document.getElementById('tag-sidebar').innerText.replace(/ /g, "_").replace(/[\?_]*(.*?)_(\(\?\)_)?[0-9]+$/gm, "$1 "); }else{ var tag = document.getElementById("post_tags").value; }