From 4436658f47fe20927e4b1f28bccdd47d25a0b86f Mon Sep 17 00:00:00 2001 From: Mark Jaquith 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: https://develop.svn.wordpress.org/trunk@10856 602fd350-edb4-49c9-b593-d223f7449a82 --- 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