Make WordPress Core

Ticket #34455: 34455.1.patch

File 34455.1.patch, 2.0 KB (added by azaozz, 9 years ago)
  • src/wp-admin/includes/class-wp-press-this.php

     
    134134                $post['post_content'] = $this->side_load_images( $post_id, $post['post_content'] );
    135135
    136136                /**
    137                  * Filter the post_content of a Press This post before saving/updating, after
     137                 * Filter the post data of a Press This post before saving/updating, after
    138138                 * side_load_images action had run.
    139139                 *
    140140                 * @since 4.5.0
    141141                 *
    142                  * @param string $content Content after side_load_images process.
    143                  * @param int    $post_id Post ID.
     142                 * @param array $post Post data.
    144143                 */
    145                 $post['post_content'] = apply_filters( 'press_this_save_post_content', $post['post_content'], $post_id );
     144                $post = apply_filters( 'press_this_save_post', $post );
    146145
    147146                $updated = wp_update_post( $post, true );
    148147
     
    283282                        return $remote_url;
    284283                }
    285284
    286                 $useful_html_elements = array(
     285                $allowed_elements = array(
    287286                        'img' => array(
    288287                                'src'      => true,
    289288                                'width'    => true,
     
    304303                        )
    305304                );
    306305
    307                 /**
    308                  * Filter 'useful' HTML elements list for fetch source step.
    309                  *
    310                  * @since 4.5.0
    311                  *
    312                  * @param array $useful_html_elements Default list of useful elements.
    313                  */
    314                 $useful_html_elements = apply_filter( 'press_this_useful_html_elements', $useful_html_elements );
    315 
    316306                $source_content = wp_remote_retrieve_body( $remote_url );
    317                 $source_content = wp_kses( $source_content, $useful_html_elements );
     307                $source_content = wp_kses( $source_content, $allowed_elements );
    318308
    319309                return $source_content;
    320310        }
     
    12131203                        }
    12141204                }
    12151205
    1216                 /**
    1217                  * Filter the assembled HTML for the Press This editor.
    1218                  *
    1219                  * @since 4.5.0
    1220                  *
    1221                  * @param string $content Assembled end output of suggested content for the Press This editor.
    1222                  */
    1223                 $content = apply_filters( 'press_this_suggested_content', $content );
    1224 
    12251206                return $content;
    12261207        }
    12271208