diff --git a/wp-admin/bookmarklet.php b/wp-admin/bookmarklet.php index addbd50bfa..80e9d68497 100644 --- a/wp-admin/bookmarklet.php +++ b/wp-admin/bookmarklet.php @@ -3,10 +3,6 @@ // accepts 'post_title' and 'content' as vars passed in. Add-on from Alex King -function selected($selected, $current) { - if ($selected == $current) echo ' selected="selected"'; -} - $mode = 'bookmarklet'; $standalone = 1; @@ -30,11 +26,48 @@ window.close() } else { + $popuptitle = stripslashes($popuptitle); + $text = stripslashes($text); + + /* big funky fixes for browsers' javascript bugs */ + + if (($is_macIE) && (!isset($IEMac_bookmarklet_fix))) { + $popuptitle = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$popuptitle); + $text = preg_replace($wp_macIE_correction["in"],$wp_macIE_correction["out"],$text); + } + + if (($is_winIE) && (!isset($IEWin_bookmarklet_fix))) { + $popuptitle = preg_replace("/\%u([0-9A-F]{4,4})/e", "''.base_convert('\\1',16,10).';'", $popuptitle); + $text = preg_replace("/\%u([0-9A-F]{4,4})/e", "''.base_convert('\\1',16,10).';'", $text); + } + + if (($is_gecko) && (!isset($Gecko_bookmarklet_fix))) { + $popuptitle = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$popuptitle); + $text = preg_replace($wp_gecko_correction["in"],$wp_gecko_correction["out"],$text); + } + + $post_title = $_REQUEST['post_title']; + if (!empty($post_title)) { + $post_title = stripslashes($post_title); + } else { + $post_title = $popuptitle; + } + + $content = $_REQUEST['content']; + if (!empty($content)) { + $content = stripslashes($content); + } else { + $content = ''.$popuptitle.''."\n$text"; + } + + /* /big funky fixes */ + ?>