]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/bookmarklet.php
Wordpress 2.5.1
[autoinstalls/wordpress.git] / wp-admin / bookmarklet.php
index 195e35ccf1e69860b34b7aeec0467d95880ca2d1..8618458dafce76272581918ad116d203d85b1b5c 100644 (file)
@@ -3,7 +3,7 @@ $mode = 'bookmarklet';
 require_once('admin.php');
 
 if ( ! current_user_can('edit_posts') )
-       die ("Cheatin' uh?");
+       wp_die(__('Cheatin’ uh?'));
 
 if ('b' == $a):
 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -25,33 +25,36 @@ $post = get_default_post_to_edit();
 
 $popuptitle = wp_specialchars(stripslashes($popuptitle));
 $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->post_title =  stripslashes($post_title);
 else
        $post->post_title = $popuptitle;
-       
-  
+
+
 $content  = wp_specialchars($_REQUEST['content']);
-$popupurl = wp_specialchars($_REQUEST['popupurl']);
-    if ( !empty($content) ) {
-        $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
-    } else {
-        $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text";
-    }
+$popupurl = clean_url($_REQUEST['popupurl']);
+if ( !empty($content) ) {
+       $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) );
+} else {
+       $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">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title><?php bloginfo('name') ?> &rsaquo; Bookmarklet &#8212; WordPress</title>
-<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
-<link rel="stylesheet" href="wp-admin.css" type="text/css" />
+<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
+<?php
+wp_admin_css( 'css/global' );
+wp_admin_css();
+?>
 
 <style type="text/css">
 <!--
@@ -77,15 +80,15 @@ $popupurl = wp_specialchars($_REQUEST['popupurl']);
 }
 
 #wpbookmarklet .wrap {
-    border: 0px;
+       border: 0px;
 }
 
 #wpbookmarklet #postdiv {
-    margin-bottom: 0.5em;
+       margin-bottom: 0.5em;
 }
 
 #wpbookmarklet #titlediv {
-    margin-bottom: 1em;
+       margin-bottom: 1em;
 }
 
 -->