Ticket #3491: pingback_extend_comment.patch
File pingback_extend_comment.patch, 1.1 KB (added by , 18 years ago) |
---|
-
xmlrpc.php
1216 1216 $sem_regexp_pb = "/(\\/|\\\|\*|\?|\+|\.|\^|\\$|\(|\)|\[|\]|\||\{|\})/"; 1217 1217 $sem_regexp_fix = "\\\\$1"; 1218 1218 $link = preg_replace( $sem_regexp_pb, $sem_regexp_fix, $pagelinkedfrom ); 1219 1219 $inlink = preg_replace( $sem_regexp_pb, $sem_regexp_fix, $pagelinkedto ); 1220 $extended_data = array(); 1221 1220 1222 $finished = false; 1221 1223 foreach ( $p as $para ) { 1222 1224 if ( $finished ) 1223 1225 continue; 1224 1226 if ( strstr( $para, $pagelinkedto ) ) { 1227 $extended_data = apply_filters('pingback_extend_comment', $para, $link, $inlink); 1228 1225 1229 $context = preg_replace( "/.*<a[^>]+".$link."[^>]*>([^>]+)<\/a>.*/", "$1", $para ); 1226 1230 $excerpt = strip_tags( $para ); 1227 1231 $excerpt = trim( $excerpt ); … … 1251 1255 1252 1256 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type'); 1253 1257 1258 $commentdata = array_merge ($commentdata, $extended_data); 1259 1254 1260 $comment_ID = wp_new_comment($commentdata); 1255 1261 do_action('pingback_post', $comment_ID); 1256 1262