]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/press-this.php
Wordpress 3.1.3
[autoinstalls/wordpress.git] / wp-admin / press-this.php
index aa4eb47f0ec709efe2644e1edb93532e818d172d..1f7b418ee53cb17959d2ad85514306fa8cfd69d7 100644 (file)
@@ -56,7 +56,12 @@ function press_it() {
                }
        }
        // set the post_content and status
-       $quick['post_status'] = isset($_POST['publish']) ? 'publish' : 'draft';
+       if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) )
+               $quick['post_status'] = 'publish';
+       elseif ( isset( $_POST['review'] ) )
+               $quick['post_status'] = 'pending';
+       else
+               $quick['post_status'] = 'draft';
        $quick['post_content'] = $content;
        // error handling for media_sideload
        if ( is_wp_error($upload) ) {
@@ -220,7 +225,7 @@ if ( !empty($_REQUEST['ajax']) ) {
                                                $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
                                        else
                                                $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src);
-                               $sources[] = esc_attr($src);
+                               $sources[] = esc_url($src);
                        }
                        return "'" . implode("','", $sources) . "'";
                }