From 4e2e3569ad9eee389de9e6b9a53b9f90474ef7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jev=20Bj=C3=B6rsell?= Date: Thu, 24 Jul 2014 13:05:59 -0700 Subject: [PATCH] Fix replace() call by removing single quotes and adding leading slash. --- frappe/public/js/frappe/form/attachments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/attachments.js b/frappe/public/js/frappe/form/attachments.js index f19811ce1f..985903b398 100644 --- a/frappe/public/js/frappe/form/attachments.js +++ b/frappe/public/js/frappe/form/attachments.js @@ -107,7 +107,7 @@ frappe.ui.form.Attachments = Class.extend({ } } // hash is not escaped, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI - return encodeURI(file_url).replace('#/g', '%23'); + return encodeURI(file_url).replace(/#/g, '%23'); }, remove_attachment_by_filename: function(filename, callback) { this.remove_attachment(this.get_attachments()[filename], callback);