Give a little love to the bookmarklet.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-10-28 08:43:23 +00:00
parent e3cb2254cd
commit 8c07d3bd1d
1 changed files with 24 additions and 28 deletions

View File

@ -5,8 +5,7 @@ require_once('admin.php');
if ( ! current_user_can('edit_posts') ) if ( ! current_user_can('edit_posts') )
die ("Cheatin' uh?"); die ("Cheatin' uh?");
if ('b' == $a) { if ('b' == $a):
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
@ -19,33 +18,32 @@ window.close()
<body></body> <body></body>
</html> </html>
<?php <?php
} else { exit;
$popuptitle = wp_specialchars(stripslashes($popuptitle)); endif;
$text = wp_specialchars(stripslashes(urldecode($text)));
$popuptitle = funky_javascript_fix($popuptitle);
$text = funky_javascript_fix($text);
$post_title = wp_specialchars($_REQUEST['post_title']);
if (!empty($post_title)) {
$post_title = stripslashes($post_title);
} else {
$post_title = $popuptitle;
}
$edited_post_title = wp_specialchars($post_title);
// $post_pingback needs to be set in any file that includes edit-form.php $post = get_default_post_to_edit();
$post_pingback = get_settings('default_pingback_flag');
$popuptitle = wp_specialchars(stripslashes($popuptitle));
$content = wp_specialchars($_REQUEST['content']); $text = wp_specialchars(stripslashes(urldecode($text)));
$popupurl = wp_specialchars($_REQUEST['popupurl']);
$popuptitle = funky_javascript_fix($popuptitle);
$text = funky_javascript_fix($text);
$post_title = wp_specialchars($_REQUEST['post_title']);
if (!empty($post_title))
$post->post_title = stripslashes($post_title);
else
$post->post_title = $popuptitle;
$content = wp_specialchars($_REQUEST['content']);
$popupurl = wp_specialchars($_REQUEST['popupurl']);
if ( !empty($content) ) { if ( !empty($content) ) {
$content = wp_specialchars( stripslashes($_REQUEST['content']) ); $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
} else { } else {
$content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text"; $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
} }
/* /big funky fixes */ /* /big funky fixes */
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -103,6 +101,4 @@ window.close()
<?php do_action('admin_footer', ''); ?> <?php do_action('admin_footer', ''); ?>
</body> </body>
</html><?php </html>
}
?>