Changeset 2972

Show
Ignore:
Timestamp:
10/28/05 08:43:23 (3 years ago)
Author:
ryan
Message:

Give a little love to the bookmarklet.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/bookmarklet.php

    r2720 r2972  
    66    die ("Cheatin' uh?"); 
    77 
    8 if ('b' == $a) { 
    9  
     8if ('b' == $a): 
    109?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    1110<html xmlns="http://www.w3.org/1999/xhtml"> 
     
    2019</html> 
    2120<?php 
    22 } else { 
    23     $popuptitle = wp_specialchars(stripslashes($popuptitle)); 
    24     $text       = wp_specialchars(stripslashes(urldecode($text))); 
     21exit; 
     22endif; 
     23 
     24$post = get_default_post_to_edit(); 
     25 
     26$popuptitle = wp_specialchars(stripslashes($popuptitle)); 
     27$text       = wp_specialchars(stripslashes(urldecode($text))); 
    2528     
    26    $popuptitle = funky_javascript_fix($popuptitle); 
    27    $text       = funky_javascript_fix($text); 
     29$popuptitle = funky_javascript_fix($popuptitle); 
     30$text       = funky_javascript_fix($text); 
    2831     
    29     $post_title = wp_specialchars($_REQUEST['post_title']); 
    30     if (!empty($post_title)) { 
    31         $post_title =  stripslashes($post_title); 
    32     } else { 
    33         $post_title = $popuptitle; 
    34     } 
     32$post_title = wp_specialchars($_REQUEST['post_title']); 
     33if (!empty($post_title)) 
     34    $post->post_title =  stripslashes($post_title); 
     35else 
     36    $post->post_title = $popuptitle; 
    3537     
    36     $edited_post_title = wp_specialchars($post_title); 
     38   
     39$content  = wp_specialchars($_REQUEST['content']); 
     40$popupurl = wp_specialchars($_REQUEST['popupurl']); 
     41    if ( !empty($content) ) { 
     42        $post->post_content = wp_specialchars( stripslashes($_REQUEST['content']) ); 
     43    } else { 
     44        $post->post_content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text"; 
     45    } 
    3746 
    38 // $post_pingback needs to be set in any file that includes edit-form.php 
    39     $post_pingback = get_settings('default_pingback_flag'); 
    40      
    41     $content  = wp_specialchars($_REQUEST['content']); 
    42     $popupurl = wp_specialchars($_REQUEST['popupurl']); 
    43     if ( !empty($content) ) { 
    44         $content = wp_specialchars( stripslashes($_REQUEST['content']) ); 
    45     } else { 
    46         $content = '<a href="'.$popupurl.'">'.$popuptitle.'</a>'."\n$text"; 
    47     } 
    48      
    4947    /* /big funky fixes */ 
    5048 
     
    104102 
    105103</body> 
    106 </html><?php 
    107 
    108 ?> 
     104</html>