<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23876] trunk/wp-includes: Chat post format code cleanup.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23876">23876</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2013-03-29 21:06:37 +0000 (Fri, 29 Mar 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Chat post format code cleanup.

see <a href="http://core.trac.wordpress.org/ticket/23625">#23625</a>. props obenland.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludespostformatsphp">trunk/wp-includes/post-formats.php</a></li>
<li><a href="#trunkwpincludesqueryphp">trunk/wp-includes/query.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludespostformatsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post-formats.php (23875 => 23876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post-formats.php        2013-03-29 20:58:38 UTC (rev 23875)
+++ trunk/wp-includes/post-formats.php        2013-03-29 21:06:37 UTC (rev 23876)
</span><span class="lines">@@ -417,7 +417,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Add chat detection support to the `get_content_chat()` chat parser
</del><ins>+ * Add chat detection support to the `get_content_chat()` chat parser.
</ins><span class="cx">  *
</span><span class="cx">  * @since 3.6.0
</span><span class="cx">  *
</span><span class="lines">@@ -484,12 +484,10 @@
</span><span class="cx">         if ( empty( $trimmed ) )
</span><span class="cx">                 return array();
</span><span class="cx"> 
</span><del>-        $has_match = false;
</del><span class="cx">         $matched_parser = false;
</span><span class="cx">         foreach ( $_wp_chat_parsers as $parser ) {
</span><del>-                @list( $newline_regex ) = $parser;
</del><ins>+                @list( $newline_regex, $delimiter_regex ) = $parser;
</ins><span class="cx">                 if ( preg_match( $newline_regex, $trimmed ) ) {
</span><del>-                        $has_match = true;
</del><span class="cx">                         $matched_parser = $parser;
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="lines">@@ -498,15 +496,11 @@
</span><span class="cx">         if ( false === $matched_parser )
</span><span class="cx">                 return array();
</span><span class="cx"> 
</span><del>-        @list( $newline_regex, $delimiter_regex ) = $parser;
-
</del><span class="cx">         $last_index = 0;
</span><del>-        $stanzas = array();
</del><ins>+        $stanzas = $data = $stanza = array();
+        $author = $time = '';
</ins><span class="cx">         $lines = explode( &quot;\n&quot;, make_clickable( $trimmed ) );
</span><span class="cx"> 
</span><del>-        $author = $time = '';
-        $data = array();
-        $stanza = array();
</del><span class="cx"> 
</span><span class="cx">         foreach ( $lines as $index =&gt; $line ) {
</span><span class="cx">                 $line = trim( $line );
</span><span class="lines">@@ -514,17 +508,16 @@
</span><span class="cx">                 if ( empty( $line ) ) {
</span><span class="cx">                         if ( ! empty( $author ) ) {
</span><span class="cx">                                 $stanza[] = array(
</span><del>-                                        'time' =&gt; $time,
-                                        'author' =&gt; $author,
</del><ins>+                                        'time'    =&gt; $time,
+                                        'author'  =&gt; $author,
</ins><span class="cx">                                         'message' =&gt; join( ' ', $data )
</span><span class="cx">                                 );
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         $stanzas[] = $stanza;
</span><span class="cx">                         $last_index = $index;
</span><del>-                        $stanza = array();
</del><ins>+                        $stanza = $data = array();
</ins><span class="cx">                         $author = $time = '';
</span><del>-                        $data = array();
</del><span class="cx">                         if ( ! empty( $lines[$index + 1] ) &amp;&amp; ! preg_match( $delimiter_regex, $lines[$index + 1] ) )
</span><span class="cx">                                 break;
</span><span class="cx">                 }
</span><span class="lines">@@ -539,8 +532,8 @@
</span><span class="cx">                 if ( $matched &amp;&amp; ( ! empty( $matches[2] ) || ( $no_ws || $has_ws ) ) ) {
</span><span class="cx">                         if ( ! empty( $author ) ) {
</span><span class="cx">                                 $stanza[] = array(
</span><del>-                                        'time' =&gt; $time,
-                                        'author' =&gt; $author,
</del><ins>+                                        'time'    =&gt; $time,
+                                        'author'  =&gt; $author,
</ins><span class="cx">                                         'message' =&gt; join( ' ', $data )
</span><span class="cx">                                 );
</span><span class="cx">                                 $data = array();
</span><span class="lines">@@ -556,8 +549,8 @@
</span><span class="cx"> 
</span><span class="cx">         if ( ! empty( $author ) ) {
</span><span class="cx">                 $stanza[] = array(
</span><del>-                        'time' =&gt; $time,
-                        'author' =&gt; $author,
</del><ins>+                        'time'    =&gt; $time,
+                        'author'  =&gt; $author,
</ins><span class="cx">                         'message' =&gt; trim( join( ' ', $data ) )
</span><span class="cx">                 );
</span><span class="cx">         }
</span><span class="lines">@@ -602,29 +595,28 @@
</span><span class="cx">  * @print HTML
</span><span class="cx">  */
</span><span class="cx"> function the_chat() {
</span><del>-        $output = '&lt;dl class=&quot;chat-transcript&quot;&gt;';
-
</del><ins>+        $output  = '&lt;dl class=&quot;chat&quot;&gt;';
</ins><span class="cx">         $stanzas = get_the_chat();
</span><span class="cx"> 
</span><span class="cx">         foreach ( $stanzas as $stanza ) {
</span><span class="cx">                 foreach ( $stanza as $row ) {
</span><span class="cx">                         $time = '';
</span><span class="cx">                         if ( ! empty( $row['time'] ) )
</span><del>-                                $time = sprintf( '&lt;time&gt;%s&lt;/time&gt;', esc_html( $row['time'] ) );
</del><ins>+                                $time = sprintf( '&lt;time class=&quot;chat-timestamp&quot;&gt;%s&lt;/time&gt;', esc_html( $row['time'] ) );
</ins><span class="cx"> 
</span><span class="cx">                         $output .= sprintf(
</span><span class="cx">                                 '&lt;dt class=&quot;chat-author chat-author-%1$s vcard&quot;&gt;%2$s &lt;cite class=&quot;fn&quot;&gt;%3$s&lt;/cite&gt;: &lt;/dt&gt;
</span><span class="cx">                                         &lt;dd class=&quot;chat-text&quot;&gt;%4$s&lt;/dd&gt;
</span><span class="cx">                                 ',
</span><del>-                                esc_attr( strtolower( $row['author'] ) ), // Slug.
</del><ins>+                                esc_attr( sanitize_title_with_dashes( $row['author'] ) ), // Slug.
</ins><span class="cx">                                 $time,
</span><span class="cx">                                 esc_html( $row['author'] ),
</span><del>-                                esc_html( $row['message'] )
</del><ins>+                                $row['message']
</ins><span class="cx">                         );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $output .= '&lt;/dl&gt;&lt;!-- .chat-transcript --&gt;';
</del><ins>+        $output .= '&lt;/dl&gt;&lt;!-- .chat --&gt;';
</ins><span class="cx"> 
</span><span class="cx">         echo $output;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludesqueryphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/query.php (23875 => 23876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/query.php        2013-03-29 20:58:38 UTC (rev 23875)
+++ trunk/wp-includes/query.php        2013-03-29 21:06:37 UTC (rev 23876)
</span><span class="lines">@@ -3626,14 +3626,14 @@
</span><span class="cx">  *
</span><span class="cx">  * @since 3.6.0
</span><span class="cx">  *
</span><del>- * @param string $content Content to split
- * @return array Paged content
</del><ins>+ * @param string $content Content to split.
+ * @return array Paged content.
</ins><span class="cx">  */
</span><span class="cx"> function paginate_content( $content ) {
</span><span class="cx">         $content = str_replace( &quot;\n&lt;!--nextpage--&gt;\n&quot;, '&lt;!--nextpage--&gt;', $content );
</span><del>-        $content = str_replace( &quot;\n&lt;!--nextpage--&gt;&quot;, '&lt;!--nextpage--&gt;', $content );
-        $content = str_replace( &quot;&lt;!--nextpage--&gt;\n&quot;, '&lt;!--nextpage--&gt;', $content );
-        return explode( '&lt;!--nextpage--&gt;', $content);
</del><ins>+        $content = str_replace( &quot;\n&lt;!--nextpage--&gt;&quot;,   '&lt;!--nextpage--&gt;', $content );
+        $content = str_replace( &quot;&lt;!--nextpage--&gt;\n&quot;,   '&lt;!--nextpage--&gt;', $content );
+        return explode( '&lt;!--nextpage--&gt;', $content );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -3642,9 +3642,10 @@
</span><span class="cx">  * @since 3.6.0
</span><span class="cx">  *
</span><span class="cx">  * @param string $content
</span><ins>+ * @param int $paged
</ins><span class="cx">  * @return string
</span><span class="cx">  */
</span><del>-function get_paged_content( $content = null, $paged = null ) {
</del><ins>+function get_paged_content( $content = '', $paged = 0 ) {
</ins><span class="cx">         global $page;
</span><span class="cx">         if ( empty( $page ) )
</span><span class="cx">                 $page = 1;
</span><span class="lines">@@ -3655,7 +3656,7 @@
</span><span class="cx">         if ( empty( $content ) ) {
</span><span class="cx">                 $post = get_post();
</span><span class="cx">                 if ( empty( $post ) )
</span><del>-                        return;
</del><ins>+                        return '';
</ins><span class="cx"> 
</span><span class="cx">                 $content = $post-&gt;post_content;
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>