From: Jerome Jutteau Date: Mon, 27 Apr 2015 17:14:09 +0000 (+0200) Subject: added date in email link and cleaner url encode X-Git-Tag: 1.1~90 X-Git-Url: https://git.p6c8.net/jirafeau_project.git/commitdiff_plain/6667b979aa92be3489dae7c9e6fa5da9cae39116?hp=b6fd6265770c82539cfb26d053e0345fe32060e0 added date in email link and cleaner url encode Signed-off-by: Jerome Jutteau --- diff --git a/lib/functions_v6.js b/lib/functions_v7.js similarity index 98% rename from lib/functions_v6.js rename to lib/functions_v7.js index 263d8fa..023c8e2 100644 --- a/lib/functions_v6.js +++ b/lib/functions_v7.js @@ -40,8 +40,11 @@ function show_link (url, reference, delete_code, crypt_key, date) // Email link var filename = document.getElementById('file_select').files[0].name; - var b = "Download%20%22" + filename + "%22 :%0D" + download_link_href + "%0D"; - document.getElementById('upload_link_email').href = "mailto:?body=" + b + "&subject=" + filename; + var b = encodeURIComponent("Download file \"" + filename + "\":") + "%0D"; + b += encodeURIComponent(download_link_href) + "%0D"; + if (date) + b += "%0D" + encodeURIComponent("This file will be available until " + date) + "%0D"; + document.getElementById('upload_link_email').href = "mailto:?body=" + b + "&subject=" + encodeURIComponent(filename); // Delete link var delete_link = url + 'f.php?h=' + reference + '&d=' + delete_code; diff --git a/lib/template/header.php b/lib/template/header.php index 92937e2..7e4b96d 100644 --- a/lib/template/header.php +++ b/lib/template/header.php @@ -35,6 +35,6 @@ else - +