Ticket #9064: comments.new_rx.diff
| File comments.new_rx.diff, 1.2 KB (added by sirzooro, 4 years ago) |
|---|
-
comment.php
old new 1394 1394 1395 1395 $pung = get_pung($post_ID); 1396 1396 1397 // Variables1398 $ltrs = '\w';1399 $gunk = '/#~:.?+=&%@!\-';1400 $punc = '.:?\-';1401 $any = $ltrs . $gunk . $punc;1402 1403 1397 // Step 1 1404 1398 // Parsing the post, external links (if any) are stored in the $post_links array 1405 // This regexp comes straight from phpfreaks.com 1406 // http://www.phpfreaks.com/quickcode/Extract_All_URLs_on_a_Page/15.php 1407 preg_match_all("{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp); 1399 preg_match_all( '/\bhref\s*=["\'\s]*http([^"\'\s]+)/i', $content, $post_links_temp ); 1408 1400 1409 1401 // Step 2. 1410 1402 // Walking thru the links array … … 1415 1407 // http://dummy-weblog.org/post.php 1416 1408 // We don't wanna ping first and second types, even if they have a valid <link/> 1417 1409 1418 foreach ( (array) $post_links_temp[ 0] as $link_test ) :1410 foreach ( (array) $post_links_temp[1] as $link_test ) : 1419 1411 if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself 1420 1412 && !is_local_attachment($link_test) ) : // Also, let's never ping local attachments. 1421 1413 if ( $test = @parse_url($link_test) ) {
