WordPress.org

Make WordPress Core

Ticket #16859: patch16859.v2.diff

File patch16859.v2.diff, 672 bytes (added by edwardw, 4 years ago)

[PATCH] Urlencode brackets when cleaning, patching wp-admin/bookmark.php instead

  • wp-admin/includes/bookmark.php

     
    3030                wp_die( __( 'Cheatin’ uh?' ) ); 
    3131 
    3232        $_POST['link_url'] = esc_html( $_POST['link_url'] ); 
     33         
     34        // Preserve parentheses and square brackets     - see #16859 
     35        $_POST['link_url'] = str_replace( Array('(',')','[',']'), Array('%28','%29','%5B','%5D'), $_POST['link_url'] ); 
     36         
    3337        $_POST['link_url'] = esc_url($_POST['link_url']); 
    3438        $_POST['link_name'] = esc_html( $_POST['link_name'] ); 
    3539        $_POST['link_image'] = esc_html( $_POST['link_image'] );