From d5cc12048e597bbb2b61c5e311c230aea8cccf76 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 6 Apr 2012 20:05:31 +0000 Subject: [PATCH] Use _callback, rather than an unhelpful 2, for a preg_replace callback function name. Add proper phpdoc. see #20369. git-svn-id: http://svn.automattic.com/wordpress/trunk@20382 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index f7ec9aa58..360c427ff 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -164,17 +164,27 @@ function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $ } add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 ); -// Private, preg_replace callback used in image_add_caption() +/** + * Private preg_replace callback used in image_add_caption() + * + * @access private + * @since 3.4.0 + */ function _cleanup_image_add_caption( $matches ) { // remove any line breaks from inside the tags $s = preg_replace( '/[\r\n\t]+/', ' ', $matches[0] ); // look for single quotes inside html attributes (for example in title) - $s = preg_replace_callback( '/="[^"]+"/', '_cleanup_image_add_caption2', $s ); + $s = preg_replace_callback( '/="[^"]+"/', '_cleanup_image_add_caption_callback', $s ); return str_replace( '"', "'", $s ); } -// Private, preg_replace callback used in image_add_caption() -function _cleanup_image_add_caption2( $matches ) { +/** + * Private preg_replace callback used in _cleanup_image_add_caption() + * + * @access private + * @since 3.4.0 + */ +function _cleanup_image_add_caption_callback( $matches ) { return str_replace( "'", ''', $matches[0] ); }