From d6aec9e60b5dad7b6e64b62dc4aa8a9f403634dc Mon Sep 17 00:00:00 2001
From: ArthurHoaro <arthur@hoa.ro>
Date: Thu, 25 May 2017 16:45:08 +0200
Subject: Selection is now limited to 2k characters using bookmarklets

to avoid having too large URL

Fixes #528
---
 tpl/default/tools.html | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tpl/default/tools.html b/tpl/default/tools.html
index 6951ad28..bf6b6ca3 100644
--- a/tpl/default/tools.html
+++ b/tpl/default/tools.html
@@ -75,7 +75,7 @@
             window.open(
               '{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+
               '&amp;title='%20+%20encodeURIComponent(title)+
-              '&amp;description='%20+%20encodeURIComponent(document.getSelection())+
+              '&amp;description='%20+%20encodeURIComponent(document.getSelection().toString().substr(0, 2000))+
               '&amp;source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'
             );
           }
@@ -91,7 +91,7 @@
           function(){
             window.open(
               '{$pageabsaddr}?private=1&amp;post='+
-              '&amp;description='%20+%20encodeURIComponent(document.getSelection())+
+              '&amp;description='%20+%20encodeURIComponent(document.getSelection().toString().substr(0, 2000))+
               '&amp;source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'
             );
           }
-- 
cgit v1.2.3