Make WordPress Core

Changeset 12336


Ignore:
Timestamp:
12/08/2009 12:48:39 AM (15 years ago)
Author:
ryan
Message:

Use stripslashes_deep to strip meta values. Props JonathanRogers, Sewar. fixes #10656

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r12328 r12336  
    560560    $metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( $_POST['metakeyselect'] ) ) : '';
    561561    $metakeyinput = isset($_POST['metakeyinput']) ? stripslashes( trim( $_POST['metakeyinput'] ) ) : '';
    562     $metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes( trim( $_POST['metavalue'] ) ) ) : '';
     562    $metavalue = isset($_POST['metavalue']) ? maybe_serialize( stripslashes_deep( $_POST['metavalue'] ) ) : '';
     563    if ( is_string($metavalue) )
     564        $metavalue = trim( $metavalue );
    563565
    564566    if ( ('0' === $metavalue || !empty ( $metavalue ) ) && ((('#NONE#' != $metakeyselect) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) {
     
    687689    wp_cache_delete($post_id, 'post_meta');
    688690
    689     $meta_value = maybe_serialize( stripslashes( $meta_value ) );
     691    $meta_value = maybe_serialize( stripslashes_deep( $meta_value ) );
    690692    $meta_id = (int) $meta_id;
    691693
Note: See TracChangeset for help on using the changeset viewer.