]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
make popup bookmarklet work in firefox when the title contains double and single...
authorChristian Weiske <cweiske@cweiske.de>
Fri, 1 Apr 2011 06:17:01 +0000 (08:17 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 1 Apr 2011 06:17:01 +0000 (08:17 +0200)
data/templates/editbookmark.tpl.php

index 8b989876242c2c2a8ddc154c6e0e181ddc7822ca..1a74290d76e1aa3794b2498813c060078967cb18 100644 (file)
@@ -20,6 +20,10 @@ function jsEscTitle($title)
 {
     return addcslashes($title, "'");
 }
+function jsEscTitleDouble($title)
+{
+    return addcslashes(addcslashes($title, "'"), "'\\");
+}
 
 if (is_array($row['tags'])) {
     $row['tags'] = implode(', ', $row['tags']);
@@ -261,7 +265,7 @@ if (browser == "Opera") {
         + 't=encodeURIComponent(x.title);'
         + 'd=encodeURIComponent('+selection+');'
         + 'open('
-        + '\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&amp;popup=1&amp;address=\'+a+\'&amp;title=\'+t+\'&amp;description=\'+d,\'<?php echo htmlspecialchars(jsEscTitle($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2'
+        + '\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&amp;popup=1&amp;address=\'+a+\'&amp;title=\'+t+\'&amp;description=\'+d,\'<?php echo htmlspecialchars(jsEscTitleDouble($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2'
         + ');void 0;">'
         + '<?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?>'
         + '</a>'