diff --git wp-includes/post-formats.php wp-includes/post-formats.php
index a6e1049..ec964b6 100644
|
|
|
function add_chat_detection_format( $name, $newline_regex, $delimiter_regex ) { |
| 453 | 453 | $_wp_chat_parsers = array( $name => array( $newline_regex, $delimiter_regex ) ) + $_wp_chat_parsers; |
| 454 | 454 | } |
| 455 | 455 | add_chat_detection_format( 'IM', '#^([^:]+):#', '#[:]#' ); |
| 456 | | add_chat_detection_format( 'Skype', '#^(\[.+?\])\s([^:]+):#', '#[:]#' ); |
| | 456 | add_chat_detection_format( 'Skype', '#(\[.+?\])\s([^:]+):#', '#[:]#' ); |
| 457 | 457 | |
| 458 | 458 | /** |
| 459 | 459 | * Deliberately interpret passed content as a chat transcript that is optionally |
| … |
… |
add_chat_detection_format( 'Skype', '#^(\[.+?\])\s([^:]+):#', '#[:]#' ); |
| 492 | 492 | function get_content_chat( &$content, $remove = false ) { |
| 493 | 493 | global $_wp_chat_parsers; |
| 494 | 494 | |
| 495 | | $trimmed = trim( $content ); |
| | 495 | $trimmed = strip_tags( trim( $content ) ); |
| 496 | 496 | if ( empty( $trimmed ) ) |
| 497 | 497 | return array(); |
| 498 | 498 | |
| … |
… |
function get_content_chat( &$content, $remove = false ) { |
| 512 | 512 | $stanzas = $data = $stanza = array(); |
| 513 | 513 | $author = $time = ''; |
| 514 | 514 | $lines = explode( "\n", make_clickable( $trimmed ) ); |
| 515 | | |
| | 515 | $found = false; |
| 516 | 516 | |
| 517 | 517 | foreach ( $lines as $index => $line ) { |
| 518 | 518 | $line = trim( $line ); |
| 519 | 519 | |
| 520 | | if ( empty( $line ) ) { |
| | 520 | if ( empty( $line ) && $found ) { |
| 521 | 521 | if ( ! empty( $author ) ) { |
| 522 | 522 | $stanza[] = array( |
| 523 | 523 | 'time' => $time, |
| … |
… |
function get_content_chat( &$content, $remove = false ) { |
| 538 | 538 | |
| 539 | 539 | $matches = array(); |
| 540 | 540 | $matched = preg_match( $newline_regex, $line, $matches ); |
| | 541 | if ( ! $matched ) |
| | 542 | continue; |
| | 543 | |
| | 544 | $found = true; |
| 541 | 545 | $author_match = empty( $matches[2] ) ? $matches[1] : $matches[2]; |
| 542 | 546 | // assume username syntax if no whitespace is present |
| 543 | 547 | $no_ws = $matched && ! preg_match( '#[\r\n\t ]#', $author_match ); |