WordPress.org

Make WordPress Core

Changeset 10856


Ignore:
Timestamp:
04/01/2009 05:45:28 AM (9 years ago)
Author:
markjaquith
Message:

preg_quote2() unnecessary. preg_quote() supports delimiter escaping if you pass it as second param

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/press-this.php

    r10855 r10856  
    1212
    1313if ( ! current_user_can('edit_posts') ) wp_die( __( 'Cheatin’ uh?' ) );
    14 
    15 /**
    16  * Replace forward slash with backslash and slash.
    17  *
    18  * @package WordPress
    19  * @subpackage Press_This
    20  * @since 2.6.0
    21  *
    22  * @param string $string
    23  * @return string
    24  */
    25 function preg_quote2($string) {
    26     return str_replace('/', '\/', preg_quote($string));
    27 }
    2814
    2915/**
     
    7258               
    7359                // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes
    74                 if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote2($image).'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
     60                if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote($image, '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
    7561            }
    7662
Note: See TracChangeset for help on using the changeset viewer.