Ticket #20369: 20369.patch
File 20369.patch, 1000 bytes (added by , 13 years ago) |
---|
-
wp-admin/includes/media.php
166 166 167 167 // Private, preg_replace callback used in image_add_caption() 168 168 function _cleanup_image_add_caption($str) { 169 if ( isset( $str[0]) ) {169 if ( isset( $str[0] ) ) { 170 170 // remove any line breaks from inside the tags 171 $s = preg_replace( '/[\r\n\t]+/', ' ', $str[0] );171 $s = preg_replace( '/[\r\n\t]+/', ' ', $str[0] ); 172 172 // look for single quotes inside html attributes (for example in title) 173 173 $s = preg_replace_callback( '/="[^"]+"/', '_cleanup_image_add_caption2', $s ); 174 174 return str_replace( '"', "'", $s ); … … 179 179 180 180 // Private, preg_replace callback used in image_add_caption() 181 181 function _cleanup_image_add_caption2($str) { 182 return str_replace( "'", ''', $str );182 return ( isset( $str[0] ) ) ? str_replace( "'", ''', $str[0] ) : ''; 183 183 } 184 184 185 185 /**