WordPress 4.1.3
[autoinstalls/wordpress.git] / wp-admin / press-this.php
index 5daa2f9bbd75c6814eac09b70b2dc1a87898d880..6ae7341f3459a98002c81be19e5bb6fe3e84783c 100644 (file)
@@ -14,7 +14,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
 header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
 
 if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) )
-       wp_die( __( 'Cheatin’ uh?' ) );
+       wp_die( __( 'Cheatin’ uh?' ), 403 );
 
 /**
  * Press It form handler.
@@ -63,7 +63,7 @@ function press_it() {
        // Error handling for media_sideload.
        if ( is_wp_error($upload) ) {
                wp_delete_post($post_ID);
-               wp_die($upload);
+               wp_die( esc_html( $upload->get_error_message() ) );
        } else {
                // Post formats.
                if ( isset( $_POST['post_format'] ) ) {
@@ -149,9 +149,9 @@ if ( !empty($_REQUEST['ajax']) ) {
                        </div>
 
                        <p class="centered">
-                               <input type="hidden" name="this_photo" value="<?php echo esc_attr($image); ?>" id="tb_this_photo" class="tb_this_photo" />
+                               <input type="hidden" name="this_photo" value="<?php echo esc_attr( $image ); ?>" id="tb_this_photo" class="tb_this_photo" />
                                <a href="#" class="select">
-                                       <img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr(__('Click to insert.')); ?>" title="<?php echo esc_attr(__('Click to insert.')); ?>" />
+                                       <img src="<?php echo esc_url( $image ); ?>" alt="<?php esc_attr_e( 'Click to insert.' ); ?>" title="<?php esc_attr_e( 'Click to insert.' ); ?>" />
                                </a>
                        </p>