From a25a1c10a796bdb190108d1e8cafe036dbd017af Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 1 Apr 2009 05:45:28 +0000 Subject: [PATCH] preg_quote2() unnecessary. preg_quote() supports delimiter escaping if you pass it as second param git-svn-id: http://svn.automattic.com/wordpress/trunk@10856 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/press-this.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index b7dc416322..26cd0a023b 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -12,20 +12,6 @@ header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('b if ( ! current_user_can('edit_posts') ) wp_die( __( 'Cheatin’ uh?' ) ); -/** - * Replace forward slash with backslash and slash. - * - * @package WordPress - * @subpackage Press_This - * @since 2.6.0 - * - * @param string $string - * @return string - */ -function preg_quote2($string) { - return str_replace('/', '\/', preg_quote($string)); -} - /** * Convert characters. * @@ -71,7 +57,7 @@ function press_it() { $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]); // Replace the POSTED content with correct uploaded ones. Regex contains fix for Magic Quotes - if( !is_wp_error($upload) ) $content = preg_replace('/]*)src=\\\?(\"|\')'.preg_quote2($image).'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); + if( !is_wp_error($upload) ) $content = preg_replace('/]*)src=\\\?(\"|\')'.preg_quote($image, '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); } // set the post_content and status