<!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>[2034] sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications: Trac Notifications: Always work with arrays due to JSON use.</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 { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { 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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/2034">2034</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/2034","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>nacin</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-11-03 05:26:50 +0000 (Tue, 03 Nov 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Trac Notifications: Always work with arrays due to JSON use.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginstracnotificationstracnotificationsdbphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-db.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginstracnotificationstracnotificationsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginstracnotificationstracnotificationsdbphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-db.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-db.php 2015-11-03 03:48:55 UTC (rev 2033)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-db.php 2015-11-03 05:26:50 UTC (rev 2034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -85,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Only show 3.8+, when this feature was launched.
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->db->get_results( "SELECT name, completed FROM milestone
</span><span class="cx" style="display: block; padding: 0 10px"> WHERE name <> 'WordPress.org' AND (completed = 0 OR completed >= 1386864000000000)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ORDER BY (completed = 0) DESC, name DESC", OBJECT_K );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ORDER BY (completed = 0) DESC, name DESC", ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function get_tickets_in_next_milestone( $component ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -103,15 +103,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'get_trac_ticket_participants' => $this->get_trac_ticket_participants( $ticket_id ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $meta['get_trac_ticket']->reporter !== $username ) {
- $meta['get_reporter_last_activity'] = $this->get_reporter_past_activity( $meta['get_trac_ticket']->reporter, $ticket_id );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $meta['get_trac_ticket']['reporter'] !== $username ) {
+ $meta['get_reporter_last_activity'] = $this->get_reporter_past_activity( $meta['get_trac_ticket']['reporter'], $ticket_id );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $meta;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function get_trac_ticket( $ticket_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $this->db->get_row( $this->db->prepare( "SELECT * FROM ticket WHERE id = %d", $ticket_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $this->db->get_row( $this->db->prepare( "SELECT * FROM ticket WHERE id = %d", $ticket_id ), ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function get_trac_ticket_focuses( $ticket_id ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,7 +163,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $activity = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $activity['tickets'] = $this->db->get_results( $this->db->prepare( "SELECT id, summary, type, status, resolution
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- FROM ticket WHERE reporter = %s AND id <= %d LIMIT 5", $reporter, $ticket ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ FROM ticket WHERE reporter = %s AND id <= %d LIMIT 5", $reporter, $ticket ), ARRAY_A );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( count( $previous_tickets ) === 1 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $activity['comments'] = (bool) $this->db->get_var( $this->db->prepare(
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginstracnotificationstracnotificationsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php 2015-11-03 03:48:55 UTC (rev 2033)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php 2015-11-03 05:26:50 UTC (rev 2034)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,6 +60,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function ticket_link( $ticket ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $ticket = (object) $ticket;
</ins><span class="cx" style="display: block; padding: 0 10px"> $status_res = $ticket->status;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ticket->resolution ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $status_res .= ': ' . $ticket->resolution;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,7 +206,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $ticket = $meta['get_trac_ticket'];
</span><span class="cx" style="display: block; padding: 0 10px"> $focuses = $meta['get_trac_ticket_focuses'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $notifications = $meta['get_trac_ticket_focuses'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notifications = $meta['get_trac_notifications_for_user'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $ticket_sub = $meta['get_trac_ticket_subscription_status_for_user'];
</span><span class="cx" style="display: block; padding: 0 10px"> $ticket_subscriptions = $meta['get_trac_ticket_subscriptions'];
</span><span class="cx" style="display: block; padding: 0 10px"> $participants = $meta['get_trac_ticket_participants'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,10 +221,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $reasons = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $username == $ticket->reporter ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $username == $ticket['reporter'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $reasons['reporter'] = 'you reported this ticket';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $username == $ticket->owner ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $username == $ticket['owner'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $reasons['owner'] = 'you own this ticket';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( $username, $participants ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,11 +245,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $notifications['component'][ $ticket->component ] ) ) {
- $reasons['component'] = sprintf( 'you have subscribed to the %s component', $ticket->component );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $notifications['component'][ $ticket['component'] ] ) ) {
+ $reasons['component'] = sprintf( 'you have subscribed to the %s component', $ticket['component'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $notifiations['milestone'][ $ticket->milestone ] ) ) {
- $reasons['milestone'] = sprintf( 'you have subscribed to the %s milestone', $ticket->milestone );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $notifiations['milestone'][ $ticket['milestone'] ] ) ) {
+ $reasons['milestone'] = sprintf( 'you have subscribed to the %s milestone', $ticket['milestone'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 === $ticket_sub ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -315,14 +316,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->ticket_notes( $ticket, $username, $meta );
</span><span class="cx" style="display: block; padding: 0 10px"> $send = array( 'notifications-box' => ob_get_clean() );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $this->components ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $send['maintainers'] = $this->components->get_component_maintainers( $ticket->component );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $send['maintainers'] = $this->components->get_component_maintainers( $ticket['component'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> wp_send_json_success( $send );
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function ticket_notes( $ticket, $username, $meta ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $username == $ticket->reporter ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $username == $ticket['reporter'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -333,7 +334,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 == count( $activity['tickets'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = '<strong>Make sure ' . $ticket->reporter . ' receives a warm welcome.</strong><br/>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = sprintf( '<strong>Make sure %s receives a warm welcome.</strong><br/>', $ticket['reporter'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $activity['comments'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= 'They’ve commented before, but it᾿s their first ticket!';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -343,20 +344,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $mapping = array( 2 => 'second', 3 => 'third', 4 => 'fourth' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = '<strong>This is only ' . $ticket->reporter . '’s ' . $mapping[ count( $activity['tickets'] ) ] . ' ticket!</strong><br/>Previously:';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = sprintf( '<strong>This is only %s’s %s ticket!</strong><br/>Previously:',
+ $ticket['reporter'], $mapping[ count( $activity['tickets'] ) ] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $activity['tickets'] as $t ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $t->id != $ticket->id ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $t['id'] != $ticket['id'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= ' ' . $this->ticket_link( $t );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= '.';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $gravatar_url = '//wordpress.org/grav-redirect.php?user=' . esc_attr( $ticket->reporter );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $gravatar_url = 'https://wordpress.org/grav-redirect.php?user=' . esc_attr( $ticket['reporter'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<p class="ticket-note note-new-reporter">';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<img width="36" height="36" src="'. $gravatar_url . '&s=36" srcset="'. $gravatar_url . '&s=72 2x" /> ';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ printf( '<img width="36" height="36" src="%1$s&s=36" srcset="%1$s&s=72 2x" /> ', $gravatar_url );
</ins><span class="cx" style="display: block; padding: 0 10px"> echo '<span class="note">' . $output . '</span>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<span class="dashicons dashicons-welcome-learn-more"></span>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -398,10 +400,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_POST['notifications']['newticket'] ) && ! empty( $notifications['newticket'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $changes['delete'][] = array( 'username' => $username, 'type' => 'newticket' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $notifications[ 'newticket' ] = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notifications['newticket'] = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! empty( $_POST['notifications']['newticket'] ) && empty( $notifications['newticket'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $changes['insert'][] = array( 'username' => $username, 'type' => 'newticket', 'value' => '1' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $notifications[ 'newticket' ] = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notifications['newticket'] = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->api->update_notifications( $changes );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -510,16 +512,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<h3>Milestones</h3>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<ul>';
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $milestones as $milestone ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $checked = checked( ! empty( $notifications['milestone'][ $milestone->name ] ), true, false );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $checked = checked( ! empty( $notifications['milestone'][ $milestone['name'] ] ), true, false );
</ins><span class="cx" style="display: block; padding: 0 10px"> $class = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $milestone->completed ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $milestone['completed'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $class = 'completed-milestone';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $checked ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $class .= ' checked';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $class = ' class="' . $class . '"';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<li' . $class . '><label><input type="checkbox" ' . $checked . 'name="notifications[milestone][' . esc_attr( $milestone->name ) . ']" /> ' . $milestone->name . '</label></li>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<li' . $class . '><label><input type="checkbox" ' . $checked . 'name="notifications[milestone][' . esc_attr( $milestone['name'] ) . ']" /> ' . $milestone['name'] . '</label></li>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<li id="show-completed"><a href="#">Show recently completed…</a></li>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</ul>';
</span></span></pre>
</div>
</div>
</body>
</html>