Changeset 20382
- Timestamp:
- 04/06/2012 08:05:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r20381 r20382 165 165 add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 ); 166 166 167 // Private, preg_replace callback used in image_add_caption() 167 /** 168 * Private preg_replace callback used in image_add_caption() 169 * 170 * @access private 171 * @since 3.4.0 172 */ 168 173 function _cleanup_image_add_caption( $matches ) { 169 174 // remove any line breaks from inside the tags 170 175 $s = preg_replace( '/[\r\n\t]+/', ' ', $matches[0] ); 171 176 // look for single quotes inside html attributes (for example in title) 172 $s = preg_replace_callback( '/="[^"]+"/', '_cleanup_image_add_caption 2', $s );177 $s = preg_replace_callback( '/="[^"]+"/', '_cleanup_image_add_caption_callback', $s ); 173 178 return str_replace( '"', "'", $s ); 174 179 } 175 180 176 // Private, preg_replace callback used in image_add_caption() 177 function _cleanup_image_add_caption2( $matches ) { 181 /** 182 * Private preg_replace callback used in _cleanup_image_add_caption() 183 * 184 * @access private 185 * @since 3.4.0 186 */ 187 function _cleanup_image_add_caption_callback( $matches ) { 178 188 return str_replace( "'", ''', $matches[0] ); 179 189 }
Note: See TracChangeset
for help on using the changeset viewer.