make popup bookmarklet work in firefox when the title contains double and single quotes. opera still broken, though
This commit is contained in:
parent
7a45f330a7
commit
43974a15f2
1 changed files with 5 additions and 1 deletions
|
@ -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&popup=1&address=\'+a+\'&title=\'+t+\'&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&popup=1&address=\'+a+\'&title=\'+t+\'&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>'
|
||||
|
|
Loading…
Reference in a new issue