From cd40717301125d8a4cf638b81395b6f18733ccfc Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 25 Mar 2017 18:44:20 +0100 Subject: [PATCH] fixing #209, refactoring regression when file upload is disabled --- js/privatebin.js | 3 ++- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index c55a0271..65d81878 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -2082,7 +2082,8 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) { */ me.hasAttachment = function() { - return ($attachmentLink.prop('href') !== '') + var link = $attachmentLink.prop('href'); + return (typeof link !== 'undefined' && link !== '') } /** diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 5381863b..e1df5d7e 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -69,7 +69,7 @@ if ($MARKDOWN): - + diff --git a/tpl/page.php b/tpl/page.php index 18d60e32..c38a1ebb 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -47,7 +47,7 @@ if ($MARKDOWN): - +