<!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>[192897] trunk/Websites/webkit.org</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">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/192897">192897</a></dd>
<dt>Author</dt> <dd>jond@apple.com</dd>
<dt>Date</dt> <dd>2015-12-01 11:44:28 -0800 (Tue, 01 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixed PHP syntax for compatibility with the server environment.

* wp-content/plugins/social-meta.php:
* wp-content/themes/webkit/functions.php:
* wp-content/themes/webkit/widgets/twitter.php:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebsiteswebkitorgChangeLog">trunk/Websites/webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsiteswebkitorgwpcontentpluginssocialmetaphp">trunk/Websites/webkit.org/wp-content/plugins/social-meta.php</a></li>
<li><a href="#trunkWebsiteswebkitorgwpcontentthemeswebkitfunctionsphp">trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php</a></li>
<li><a href="#trunkWebsiteswebkitorgwpcontentthemeswebkitwidgetstwitterphp">trunk/Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebsiteswebkitorgChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Websites/webkit.org/ChangeLog (192896 => 192897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/ChangeLog        2015-12-01 19:31:58 UTC (rev 192896)
+++ trunk/Websites/webkit.org/ChangeLog        2015-12-01 19:44:28 UTC (rev 192897)
</span><span class="lines">@@ -1,5 +1,13 @@
</span><span class="cx"> 2015-12-01  Jonathan Davis  &lt;jond@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Fixed PHP syntax for compatibility with the server environment.
+
+        * wp-content/plugins/social-meta.php:
+        * wp-content/themes/webkit/functions.php:
+        * wp-content/themes/webkit/widgets/twitter.php:
+
+2015-12-01  Jonathan Davis  &lt;jond@apple.com&gt;
+
</ins><span class="cx">         Updated webkit.org to use the new theme and WordPress deployment.
</span><span class="cx"> 
</span><span class="cx">         * .htaccess:
</span></span></pre></div>
<a id="trunkWebsiteswebkitorgwpcontentpluginssocialmetaphp"></a>
<div class="modfile"><h4>Modified: trunk/Websites/webkit.org/wp-content/plugins/social-meta.php (192896 => 192897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/wp-content/plugins/social-meta.php        2015-12-01 19:31:58 UTC (rev 192896)
+++ trunk/Websites/webkit.org/wp-content/plugins/social-meta.php        2015-12-01 19:44:28 UTC (rev 192897)
</span><span class="lines">@@ -8,8 +8,11 @@
</span><span class="cx"> */
</span><span class="cx"> 
</span><span class="cx"> add_action('wp_head', function() { ?&gt;
</span><del>-    &lt;?php $image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'large' )[0]; ?&gt;
-    
</del><ins>+    &lt;?php
+        $image_src = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'large' );
+        $image_url = $image_src[0];
+    ?&gt;
+
</ins><span class="cx">     &lt;!-- Schema.org markup --&gt;
</span><span class="cx">     &lt;meta itemprop=&quot;name&quot; content=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;
</span><span class="cx">     &lt;meta itemprop=&quot;description&quot; content=&quot;&lt;?php the_excerpt(); ?&gt;&quot;&gt;
</span><span class="lines">@@ -28,7 +31,7 @@
</span><span class="cx">     &lt;?php if ( $image_url ): // Twitter summary card with large image must be at least 280x150px ?&gt;
</span><span class="cx">     &lt;meta name=&quot;twitter:image:src&quot; content=&quot;&lt;?php echo $image_url; ?&gt;&quot;&gt;
</span><span class="cx">     &lt;?php endif; ?&gt;
</span><del>-    
</del><ins>+
</ins><span class="cx">     &lt;!-- Open Graph data --&gt;
</span><span class="cx">     &lt;meta property=&quot;og:title&quot; content=&quot;&lt;?php the_title(); ?&gt;&quot; /&gt;
</span><span class="cx">     &lt;meta property=&quot;og:type&quot; content=&quot;article&quot; /&gt;
</span><span class="lines">@@ -40,11 +43,11 @@
</span><span class="cx">     &lt;meta property=&quot;og:site_name&quot; content=&quot;&lt;?php bloginfo('title'); ?&gt;&quot; /&gt;
</span><span class="cx">     &lt;meta property=&quot;article:published_time&quot; content=&quot;&lt;?php the_time('c'); ?&gt;&quot; /&gt;
</span><span class="cx">     &lt;meta property=&quot;article:modified_time&quot; content=&quot;&lt;?php the_modified_date('c'); ?&gt;&quot; /&gt;
</span><del>-    &lt;?php     
</del><ins>+    &lt;?php
</ins><span class="cx">         $categories = wp_get_object_terms( get_the_ID(), 'category', array( 'fields' =&gt; 'names' ) );
</span><span class="cx">         $tags = wp_get_object_terms( get_the_ID(), 'post_tag', array( 'fields' =&gt; 'names' ) );
</span><del>-        
-        if ( ! empty($categories) ): 
</del><ins>+
+        if ( ! empty($categories) ):
</ins><span class="cx">             $section = array_shift($categories);      // The first category is used as the section
</span><span class="cx">             $tags = array_merge($categories, $tags);  // The rest are prepended to the tag list
</span><span class="cx">     ?&gt;
</span><span class="lines">@@ -58,6 +61,6 @@
</span><span class="cx">     &lt;?php
</span><span class="cx">         endforeach; endif;
</span><span class="cx">     ?&gt;
</span><del>-    
</del><ins>+
</ins><span class="cx"> &lt;?php
</span><span class="cx"> });
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkWebsiteswebkitorgwpcontentthemeswebkitfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php (192896 => 192897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php        2015-12-01 19:31:58 UTC (rev 192896)
+++ trunk/Websites/webkit.org/wp-content/themes/webkit/functions.php        2015-12-01 19:44:28 UTC (rev 192897)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> 
</span><span class="cx"> // Declare theme features
</span><del>-add_theme_support( 'post-thumbnails' ); 
</del><ins>+add_theme_support( 'post-thumbnails' );
</ins><span class="cx"> 
</span><span class="cx"> function register_menus() {
</span><span class="cx"> }
</span><span class="lines">@@ -13,36 +13,36 @@
</span><span class="cx"> 
</span><span class="cx"> function modify_contact_methods($profile_fields) {
</span><span class="cx"> 
</span><del>-        // Add new fields
-        $profile_fields['twitter'] = 'Twitter Handle';
-        unset($profile_fields['aim']);
-        unset($profile_fields['yim']);
-        unset($profile_fields['jabber']);
</del><ins>+    // Add new fields
+    $profile_fields['twitter'] = 'Twitter Handle';
+    unset($profile_fields['aim']);
+    unset($profile_fields['yim']);
+    unset($profile_fields['jabber']);
</ins><span class="cx"> 
</span><del>-        return $profile_fields;
</del><ins>+    return $profile_fields;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> add_filter('user_contactmethods', function ($fields) {
</span><span class="cx">     // Add Twitter field to user profiles
</span><del>-        $fields['twitter'] = 'Twitter Handle';
-    
</del><ins>+    $fields['twitter'] = 'Twitter Handle';
+
</ins><span class="cx">     // Remove unused social networks
</span><del>-        unset($fields['aim']);
-        unset($fields['yim']);
-        unset($fields['jabber']);
</del><ins>+    unset($fields['aim']);
+    unset($fields['yim']);
+    unset($fields['jabber']);
</ins><span class="cx"> 
</span><del>-        return $fields;
</del><ins>+    return $fields;
</ins><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> add_action('init', function () {
</span><del>-        register_sidebar(array(
-                'name'=&gt; 'Home Tiles',
-                'id' =&gt; 'tiles',
-                'before_widget' =&gt; '',
-                'after_widget' =&gt; '',
-                'before_title' =&gt; '',
-                'after_title' =&gt; '',
-        ));
</del><ins>+    register_sidebar(array(
+        'name'=&gt; 'Home Tiles',
+        'id' =&gt; 'tiles',
+        'before_widget' =&gt; '',
+        'after_widget' =&gt; '',
+        'before_title' =&gt; '',
+        'after_title' =&gt; '',
+    ));
</ins><span class="cx"> } );
</span><span class="cx"> 
</span><span class="cx"> add_filter('the_title', function( $title ) {
</span><span class="lines">@@ -66,10 +66,10 @@
</span><span class="cx"> 
</span><span class="cx"> add_filter( 'get_the_excerpt', function( $excerpt ) {
</span><span class="cx">     $sentences = preg_split( '/(\.|!|\?)\s/', $excerpt, 2, PREG_SPLIT_DELIM_CAPTURE );
</span><del>-    
</del><ins>+
</ins><span class="cx">     // if ( empty($sentences[1]) )
</span><span class="cx">     //     $sentences[1] = '&amp;hellip;';
</span><del>-    
</del><ins>+
</ins><span class="cx">     return $sentences[0] . $sentences[1];
</span><span class="cx"> 
</span><span class="cx"> });
</span><span class="lines">@@ -97,10 +97,11 @@
</span><span class="cx">     $tags = array();
</span><span class="cx"> 
</span><span class="cx">     // Get the image data
</span><del>-        $image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'small' )[0];
-    
</del><ins>+    $image_src = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'small' );
+    $image_url = $image_src[0];
+
</ins><span class="cx">     if ( empty($image_url) ) return $post_id;
</span><del>-    
</del><ins>+
</ins><span class="cx">     // detect luminence value
</span><span class="cx">     $luminance = calculate_image_luminance($image_url);
</span><span class="cx">     $tags = wp_get_post_tags($post_id, array('fields' =&gt; 'names'));
</span><span class="lines">@@ -113,66 +114,66 @@
</span><span class="cx">     // Set a tag class
</span><span class="cx">     if ( ! empty($tags) )
</span><span class="cx">         wp_set_post_tags( $post_id, $tags, true );
</span><del>-    
</del><ins>+
</ins><span class="cx">     return $post_id;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function calculate_image_luminance($image_url) {
</span><span class="cx">     // Get original image dimensions
</span><span class="cx">     $size = getimagesize($image_url);
</span><del>-    
</del><ins>+
</ins><span class="cx">     // Create image resource from source image
</span><span class="cx">     $image = ImageCreateFromString(file_get_contents($image_url));
</span><del>-    
</del><ins>+
</ins><span class="cx">     // Allocate image resource
</span><span class="cx">     $sample = ImageCreateTrueColor(1, 1);
</span><del>-    
</del><ins>+
</ins><span class="cx">     // Flood fill with a white background (to properly calculate luminance of PNGs with alpha)
</span><span class="cx">     ImageFill($sample , 0, 0, ImageColorAllocate($sample, 255, 255, 255));
</span><del>-    
</del><ins>+
</ins><span class="cx">     // Downsample to 1x1 image
</span><span class="cx">     ImageCopyResampled($sample, $image, 0, 0, 0, 0, 1, 1, $size[0], $size[1]);
</span><span class="cx"> 
</span><span class="cx">     // Get the RGB value of the pixel
</span><del>-    $rgb   = ImageColorAt($sample, 0, 0);    
</del><ins>+    $rgb   = ImageColorAt($sample, 0, 0);
</ins><span class="cx">     $red   = ($rgb &gt;&gt; 16) &amp; 0xFF;
</span><span class="cx">     $green = ($rgb &gt;&gt; 8) &amp; 0xFF;
</span><span class="cx">     $blue  = $rgb &amp; 0xFF;
</span><del>-    
</del><ins>+
</ins><span class="cx">     // Calculate relative luminance value (https://en.wikipedia.org/wiki/Relative_luminance)
</span><span class="cx">     return ( 0.2126 * $red + 0.7152 * $green + 0.0722 * $blue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function html_select_options(array $list, $selected = null, $values = false, $append = false) {
</span><del>-                if ( ! is_array($list) ) return '';
</del><ins>+        if ( ! is_array($list) ) return '';
</ins><span class="cx"> 
</span><del>-                $_ = '';
-        
-                // Append the options if the selected value doesn't exist
-                if ( ( ! in_array($selected, $list) &amp;&amp; ! isset($list[ $selected ])) &amp;&amp; $append )
-                        $_ .= '&lt;option value=&quot;' . esc_attr($selected) . '&quot;&gt;' .esc_html($selected) . '&lt;/option&gt;';
</del><ins>+        $_ = '';
</ins><span class="cx"> 
</span><del>-                foreach ( $list as $value =&gt; $text ) {
</del><ins>+        // Append the options if the selected value doesn't exist
+        if ( ( ! in_array($selected, $list) &amp;&amp; ! isset($list[ $selected ])) &amp;&amp; $append )
+            $_ .= '&lt;option value=&quot;' . esc_attr($selected) . '&quot;&gt;' .esc_html($selected) . '&lt;/option&gt;';
</ins><span class="cx"> 
</span><del>-                        $value_attr = $selected_attr = '';
</del><ins>+        foreach ( $list as $value =&gt; $text ) {
</ins><span class="cx"> 
</span><del>-                        if ( $values ) $value_attr = ' value=&quot;' . esc_attr($value) . '&quot;';
-                        if ( ( $values &amp;&amp; (string)$value === (string)$selected)
-                                || ( ! $values &amp;&amp; (string)$text === (string)$selected ) )
-                                        $selected_attr = ' selected=&quot;selected&quot;';
-    
-                        if ( is_array($text) ) {
-                                $label = $value;
-                                $_ .= '&lt;optgroup label=&quot;' . esc_attr($label) . '&quot;&gt;';
-                                $_ .= self::menuoptions($text, $selected, $values);
-                                $_ .= '&lt;/optgroup&gt;';
-                                continue;
-                        } else $_ .= &quot;&lt;option$value_attr$selected_attr&gt;$text&lt;/option&gt;&quot;;
</del><ins>+            $value_attr = $selected_attr = '';
</ins><span class="cx"> 
</span><del>-                }
-                return $_;
-        }
</del><ins>+            if ( $values ) $value_attr = ' value=&quot;' . esc_attr($value) . '&quot;';
+            if ( ( $values &amp;&amp; (string)$value === (string)$selected)
+                || ( ! $values &amp;&amp; (string)$text === (string)$selected ) )
+                    $selected_attr = ' selected=&quot;selected&quot;';
</ins><span class="cx"> 
</span><ins>+            if ( is_array($text) ) {
+                $label = $value;
+                $_ .= '&lt;optgroup label=&quot;' . esc_attr($label) . '&quot;&gt;';
+                $_ .= self::menuoptions($text, $selected, $values);
+                $_ .= '&lt;/optgroup&gt;';
+                continue;
+            } else $_ .= &quot;&lt;option$value_attr$selected_attr&gt;$text&lt;/option&gt;&quot;;
+
+        }
+        return $_;
+    }
+
</ins><span class="cx"> add_filter('save_post', 'tag_post_image_luminance');
</span><span class="cx"> 
</span><span class="cx"> add_filter('next_post_link', function ( $format ) {
</span><span class="lines">@@ -199,10 +200,10 @@
</span><span class="cx"> } );
</span><span class="cx"> 
</span><span class="cx"> class Responsive_Toggle_Walker_Nav_Menu extends Walker_Nav_Menu {
</span><del>-    
</del><ins>+
</ins><span class="cx">     private $toggleid = null;
</span><del>-    
-        public function start_lvl( &amp;$output, $depth = 0, $args = array() ) {
</del><ins>+
+    public function start_lvl( &amp;$output, $depth = 0, $args = array() ) {
</ins><span class="cx">         $output .= &quot;\n&quot; . str_repeat(&quot;\t&quot;, $depth);
</span><span class="cx">         if ( ! empty($this-&gt;toggleid) )
</span><span class="cx">             $output .= &quot;&lt;input type=\&quot;checkbox\&quot; id=\&quot;toggle-{$this-&gt;toggleid}\&quot; class=\&quot;menu-toggle\&quot; /&gt;&quot;;
</span><span class="lines">@@ -214,17 +215,17 @@
</span><span class="cx">         $class_names = esc_attr(join( ' ', $classes ));
</span><span class="cx">         $output .= &quot;&lt;ul class=\&quot;$class_names\&quot; role=\&quot;menu\&quot;$id&gt;\n&quot;;
</span><span class="cx">     }
</span><del>-    
-        public function end_lvl( &amp;$output, $depth = 0, $args = array() ) {
-                $indent = str_repeat(&quot;\t&quot;, $depth);
-                $output .= &quot;$indent&lt;/ul&gt;\n&quot;;
-        }
-    
</del><ins>+
+    public function end_lvl( &amp;$output, $depth = 0, $args = array() ) {
+        $indent = str_repeat(&quot;\t&quot;, $depth);
+        $output .= &quot;$indent&lt;/ul&gt;\n&quot;;
+    }
+
</ins><span class="cx">     public function start_el( &amp;$output, $item, $depth = 0, $args = array(), $id = 0 ) {
</span><del>-        
</del><ins>+
</ins><span class="cx">         $before = $args-&gt;link_before;
</span><span class="cx">         $after = $args-&gt;link_after;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( in_array('menu-item-has-children', $item-&gt;classes) &amp;&amp; 0 == $depth ) {
</span><span class="cx">             $args-&gt;link_before = &quot;&lt;label for=\&quot;toggle-{$item-&gt;ID}\&quot; class=\&quot;label-toggle\&quot;&gt;&quot; . $args-&gt;link_before;
</span><span class="cx">             $args-&gt;link_after .= &quot;&lt;/label&gt;&quot;;
</span><span class="lines">@@ -232,77 +233,77 @@
</span><span class="cx">             $item-&gt;url = '#nav-sub-menu';
</span><span class="cx">         } elseif ( in_array('menu-item-has-children', $item-&gt;classes) &amp;&amp; 1 == $depth ) {
</span><span class="cx">             // $item-&gt;role = &quot;presentation&quot;;
</span><del>-        } else $toggleid = null;        
-        
-                $indent = ( $depth ) ? str_repeat( &quot;\t&quot;, $depth ) : '';
</del><ins>+        } else $toggleid = null;
</ins><span class="cx"> 
</span><del>-                $classes = empty( $item-&gt;classes ) ? array() : (array) $item-&gt;classes;
-                $classes[] = 'menu-item-' . $item-&gt;ID;
</del><ins>+        $indent = ( $depth ) ? str_repeat( &quot;\t&quot;, $depth ) : '';
</ins><span class="cx"> 
</span><del>-                $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) );
-                $class_names = $class_names ? ' class=&quot;' . esc_attr( $class_names ) . '&quot;' : '';
</del><ins>+        $classes = empty( $item-&gt;classes ) ? array() : (array) $item-&gt;classes;
+        $classes[] = 'menu-item-' . $item-&gt;ID;
</ins><span class="cx"> 
</span><del>-                $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item-&gt;ID, $item, $args, $depth );
-                $id = $id ? ' id=&quot;' . esc_attr( $id ) . '&quot;' : '';
</del><ins>+        $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) );
+        $class_names = $class_names ? ' class=&quot;' . esc_attr( $class_names ) . '&quot;' : '';
</ins><span class="cx"> 
</span><del>-                $output .= $indent . '&lt;li' . $id . $class_names . '&gt;';
</del><ins>+        $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item-&gt;ID, $item, $args, $depth );
+        $id = $id ? ' id=&quot;' . esc_attr( $id ) . '&quot;' : '';
</ins><span class="cx"> 
</span><del>-                $atts = array();
-                $atts['title']  = ! empty( $item-&gt;attr_title ) ? $item-&gt;attr_title : '';
-                $atts['target'] = ! empty( $item-&gt;target )     ? $item-&gt;target     : '';
-                $atts['rel']    = ! empty( $item-&gt;xfn )        ? $item-&gt;xfn        : '';
-                $atts['href']   = ! empty( $item-&gt;url )        ? $item-&gt;url        : '';
</del><ins>+        $output .= $indent . '&lt;li' . $id . $class_names . '&gt;';
+
+        $atts = array();
+        $atts['title']  = ! empty( $item-&gt;attr_title ) ? $item-&gt;attr_title : '';
+        $atts['target'] = ! empty( $item-&gt;target )     ? $item-&gt;target     : '';
+        $atts['rel']    = ! empty( $item-&gt;xfn )        ? $item-&gt;xfn        : '';
+        $atts['href']   = ! empty( $item-&gt;url )        ? $item-&gt;url        : '';
</ins><span class="cx">         $atts['role']   = ! empty( $item-&gt;role )       ? $item-&gt;role       : '';
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( in_array('menu-item-has-children', $item-&gt;classes) &amp;&amp; 0 == $depth ) {
</span><span class="cx">             $atts['aria-haspopup'] = &quot;true&quot;;
</span><span class="cx">             $atts['aria-owns'] = 'sub-menu-for-' . $item-&gt;ID;
</span><span class="cx">             $atts['aria-controls'] = 'sub-menu-for-' . $item-&gt;ID;
</span><span class="cx">             $atts['aria-expanded'] = 'true';
</span><span class="cx">         }
</span><del>-        
-                $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth );
</del><span class="cx"> 
</span><del>-                $attributes = '';
-                foreach ( $atts as $attr =&gt; $value ) {
-                        if ( ! empty( $value ) ) {
-                                $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
-                                $attributes .= ' ' . $attr . '=&quot;' . $value . '&quot;';
-                        }
-                }
</del><ins>+        $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args, $depth );
</ins><span class="cx"> 
</span><del>-                $item_output = $args-&gt;before;
-                $item_output .= '&lt;a'. $attributes .'&gt;';
-                $item_output .= $args-&gt;link_before . apply_filters( 'the_title', $item-&gt;title, $item-&gt;ID ) . $args-&gt;link_after;
-                $item_output .= '&lt;/a&gt;';
-                $item_output .= $args-&gt;after;
</del><ins>+        $attributes = '';
+        foreach ( $atts as $attr =&gt; $value ) {
+            if ( ! empty( $value ) ) {
+                $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
+                $attributes .= ' ' . $attr . '=&quot;' . $value . '&quot;';
+            }
+        }
</ins><span class="cx"> 
</span><del>-                $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
-        
</del><ins>+        $item_output = $args-&gt;before;
+        $item_output .= '&lt;a'. $attributes .'&gt;';
+        $item_output .= $args-&gt;link_before . apply_filters( 'the_title', $item-&gt;title, $item-&gt;ID ) . $args-&gt;link_after;
+        $item_output .= '&lt;/a&gt;';
+        $item_output .= $args-&gt;after;
+
+        $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
+
</ins><span class="cx">         $args-&gt;link_before = $before;
</span><span class="cx">         $args-&gt;link_after = $after;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class Front_Page_Posts {
</span><del>-    
-        private static $object;     // Singleton instance

</del><ins>+
+    private static $object;     // Singleton instance
+
</ins><span class="cx">     private static $wp_query;   // WP_Query instance
</span><del>-    
-        public static function &amp;object () {
-                if ( ! self::$object instanceof self )
-                        self::$object = new self;
-        
</del><ins>+
+    public static function &amp;object () {
+        if ( ! self::$object instanceof self )
+            self::$object = new self;
+
</ins><span class="cx">         if ( empty(self::$wp_query) )
</span><span class="cx">             self::$wp_query = new WP_Query(array('post_type' =&gt; 'post'));
</span><del>-        
-                return self::$object;
-        }
-    
</del><ins>+
+        return self::$object;
+    }
+
</ins><span class="cx">     public static function WP_Query() {
</span><span class="cx">         return self::$wp_query;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkWebsiteswebkitorgwpcontentthemeswebkitwidgetstwitterphp"></a>
<div class="modfile"><h4>Modified: trunk/Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php (192896 => 192897)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php        2015-12-01 19:31:58 UTC (rev 192896)
+++ trunk/Websites/webkit.org/wp-content/themes/webkit/widgets/twitter.php        2015-12-01 19:44:28 UTC (rev 192897)
</span><span class="lines">@@ -7,23 +7,23 @@
</span><span class="cx"> defined('WPINC') || header('HTTP/1.1 403') &amp; exit; // Prevent direct access
</span><span class="cx"> 
</span><span class="cx"> if ( ! class_exists('WP_Widget') ) return;
</span><del>-        
</del><ins>+
</ins><span class="cx"> class WebKitTwitterTileWidget extends WebKitPostTileWidget {
</span><del>-    
</del><ins>+
</ins><span class="cx">     const CACHEKEY = 'webkit_twitter_feed';
</span><span class="cx"> 
</span><span class="cx">     function __construct() {
</span><del>-        parent::WP_Widget(false, 
-                        __('Twitter Tile'), 
-                        array('description' =&gt; __('Twitter tile for the home page'))
-                );
</del><ins>+        parent::WP_Widget(false,
+            __('Twitter Tile'),
+            array('description' =&gt; __('Twitter tile for the home page'))
+        );
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function widget( array $args, array $options ) {
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( ! empty($args) )
</span><span class="cx">             extract($args, EXTR_SKIP);
</span><del>-        
</del><ins>+
</ins><span class="cx">         $Tweet = $this-&gt;tweet();
</span><span class="cx"> 
</span><span class="cx">         // Show &quot;Follow @webkit&quot; instead of tweet for empty text
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">         if ( ! empty($Tweet-&gt;text) )
</span><span class="cx">             $text = $Tweet-&gt;text;
</span><span class="cx"> 
</span><del>-        if ( ! empty($options['url']) ) 
</del><ins>+        if ( ! empty($options['url']) )
</ins><span class="cx">             $url = (string)$options['url'];
</span><span class="cx"> 
</span><span class="cx">         // Expand URLs
</span><span class="lines">@@ -53,11 +53,11 @@
</span><span class="cx">                                  . $entry-&gt;display_url . '&lt;/a&gt;';
</span><span class="cx">             $text = str_replace($entry-&gt;url, $expanded, $text);
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         $text = preg_replace('/RT @[^:]+:\s+/', '', $text, 1);
</span><del>-        
-        if ( empty($Tweet-&gt;entities) || empty($Tweet-&gt;entities-&gt;media) ) { 
</del><span class="cx"> 
</span><ins>+        if ( empty($Tweet-&gt;entities) || empty($Tweet-&gt;entities-&gt;media) ) {
+
</ins><span class="cx">             $Image = $Tweet-&gt;entities-&gt;media[0];
</span><span class="cx">             if ( empty($Image) ) $classes[] = 'text-only';
</span><span class="cx"> 
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">                 $text = str_replace($entry-&gt;url, '', $text);
</span><span class="cx">             }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         ?&gt;
</span><span class="cx">         &lt;div class=&quot;&lt;?php echo esc_attr(join(' ', $classes)); ?&gt;&quot;&gt;
</span><span class="cx">             &lt;a href=&quot;http://twitter.com/webkit/status/&lt;?php echo esc_attr($Tweet-&gt;id); ?&gt;&quot; class=&quot;tile-link&quot;&gt;Clickable link to tweet&lt;/a&gt;
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">             &lt;?php else: ?&gt;
</span><span class="cx">             &lt;?php endif;?&gt;
</span><span class="cx">                 &lt;p&gt;&lt;?php echo $text; ?&gt;&lt;/p&gt;
</span><del>-            
</del><ins>+
</ins><span class="cx">             &lt;/div&gt;
</span><span class="cx">             &lt;ul class=&quot;twitter-controls&quot;&gt;
</span><span class="cx">                 &lt;li&gt;&lt;a href=&quot;https://twitter.com/intent/follow?screen_name=webkit&quot; target=&quot;twitter-modal&quot;&gt;&lt;span class=&quot;twitter-icon&quot;&gt;Twitter&lt;/span&gt; @webkit&lt;/a&gt;&lt;/li&gt;
</span><span class="lines">@@ -87,12 +87,12 @@
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx">         &lt;?php
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     function follow_markup ($options) {
</span><del>-        
</del><ins>+
</ins><span class="cx">         $url = 'https://twitter.com/intent/follow?screen_name=webkit';
</span><span class="cx">         $classes = array('tile', 'third-tile', 'twitter-tile');
</span><del>-        
</del><ins>+
</ins><span class="cx">         ?&gt;
</span><span class="cx">         &lt;div class=&quot;&lt;?php echo esc_attr(join(' ', $classes)); ?&gt;&quot;&gt;
</span><span class="cx">             &lt;a class=&quot;tile-link&quot; href=&quot;&lt;?php echo esc_url($url); ?&gt;&quot;&gt;Clickable link&lt;/a&gt;
</span><span class="lines">@@ -103,86 +103,87 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function form( array $options ) {
</span><del>-                ?&gt;
-                &lt;p&gt;&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('text'); ?&gt;&quot;&gt;&lt;?php _e('Text'); ?&gt;&lt;/label&gt;
-                &lt;textarea type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('text'); ?&gt;&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('text'); ?&gt;&quot; class=&quot;widefat&quot;&gt;&lt;?php echo $options['text']; ?&gt;&lt;/textarea&gt;&lt;/p&gt;
-                &lt;?php
</del><ins>+        ?&gt;
+        &lt;p&gt;&lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('text'); ?&gt;&quot;&gt;&lt;?php _e('Text'); ?&gt;&lt;/label&gt;
+        &lt;textarea type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('text'); ?&gt;&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('text'); ?&gt;&quot; class=&quot;widefat&quot;&gt;&lt;?php echo $options['text']; ?&gt;&lt;/textarea&gt;&lt;/p&gt;
+        &lt;?php
</ins><span class="cx">     }
</span><del>-    
-        function tweet () {
</del><span class="cx"> 
</span><ins>+    function tweet () {
+
</ins><span class="cx">         if ( false !== ( $cached = get_transient(self::CACHEKEY) ) )
</span><span class="cx">             return json_decode($cached);
</span><del>-        
-                $endpoint = 'https://api.twitter.com/1.1/statuses/user_timeline.json';
-                $parameters = array();
-                $options = array(
-                        'method' =&gt; 'GET',
-                );
</del><span class="cx"> 
</span><del>-                $oauth_consumer_key = 'ypSvRp37vmyt3ldMPhs0e62c9';
-                $oauth_consumer_key_secret = 'mLuYD3AjUehUZKOgQIICA5Na69te45aSJTkdIDTGSg4cfHd6Lz';
-                $oauth_token = '14315023-7pHbcI5bk2QZhNiHR9uFudaksBzMPubEuOEmYj7YQ';
-                $oauth_token_secret = '0K9T9znxG4S9PUGunYZ5LwyKL9AR6v3eAXp6WKY2oi7Bg';
-                $oauth_timestamp = time();
-                $oauth_nonce = sha1(rand() . $oauth_timestamp);
</del><ins>+        $endpoint = 'https://api.twitter.com/1.1/statuses/user_timeline.json';
+        $parameters = array();
+        $options = array(
+            'method' =&gt; 'GET',
+        );
</ins><span class="cx"> 
</span><del>-                $fields = array(
-                        'oauth_consumer_key' =&gt; $oauth_consumer_key,
-                        'oauth_nonce' =&gt; sha1(rand() . time()),
-                        'oauth_signature_method' =&gt; 'HMAC-SHA1',
-                        'oauth_timestamp' =&gt; time(),
-                        'oauth_token' =&gt; $oauth_token,
-                        'oauth_version' =&gt; '1.0',
-                );
-                $fields = array_merge($parameters, $fields);
</del><ins>+        $oauth_consumer_key = 'ypSvRp37vmyt3ldMPhs0e62c9';
+        $oauth_consumer_key_secret = 'mLuYD3AjUehUZKOgQIICA5Na69te45aSJTkdIDTGSg4cfHd6Lz';
+        $oauth_token = '14315023-7pHbcI5bk2QZhNiHR9uFudaksBzMPubEuOEmYj7YQ';
+        $oauth_token_secret = '0K9T9znxG4S9PUGunYZ5LwyKL9AR6v3eAXp6WKY2oi7Bg';
+        $oauth_timestamp = time();
+        $oauth_nonce = sha1(rand() . $oauth_timestamp);
</ins><span class="cx"> 
</span><del>-                $base = array(
-                        'GET', $endpoint, http_build_query($fields, '', '&amp;')
-                );
-                $base = join('&amp;', array_map('rawurlencode', $base));
</del><ins>+        $fields = array(
+            'oauth_consumer_key' =&gt; $oauth_consumer_key,
+            'oauth_nonce' =&gt; sha1(rand() . time()),
+            'oauth_signature_method' =&gt; 'HMAC-SHA1',
+            'oauth_timestamp' =&gt; time(),
+            'oauth_token' =&gt; $oauth_token,
+            'oauth_version' =&gt; '1.0',
+        );
+        $fields = array_merge($parameters, $fields);
</ins><span class="cx"> 
</span><ins>+        $base = array(
+            'GET', $endpoint, http_build_query($fields, '', '&amp;')
+        );
+        $base = join('&amp;', array_map('rawurlencode', $base));
</ins><span class="cx"> 
</span><del>-                $key = array(
-                        $oauth_consumer_key_secret, $oauth_token_secret
-                );
-                $key = join('&amp;', array_map('rawurlencode', $key));
</del><span class="cx"> 
</span><del>-                $signature = base64_encode( hash_hmac('sha1', $base, $key, true) );
</del><ins>+        $key = array(
+            $oauth_consumer_key_secret, $oauth_token_secret
+        );
+        $key = join('&amp;', array_map('rawurlencode', $key));
</ins><span class="cx"> 
</span><del>-                $oauth = array(
-                        'oauth_consumer_key' =&gt; $oauth_consumer_key,
-                        'oauth_nonce' =&gt; $fields['oauth_nonce'],
-                        'oauth_signature' =&gt; $signature,
-                        'oauth_signature_method' =&gt; 'HMAC-SHA1',
-                        'oauth_timestamp' =&gt; $fields['oauth_timestamp'],
-                        'oauth_token' =&gt; $oauth_token,
-                        'oauth_version' =&gt; '1.0',
-                );
-                $oauth = array_map(create_function('$h','return &quot;\&quot;$h\&quot;&quot;;'), $oauth);
</del><ins>+        $signature = base64_encode( hash_hmac('sha1', $base, $key, true) );
</ins><span class="cx"> 
</span><del>-                $oauth = http_build_query($oauth, '', ', ');
-                $oauth = str_replace('%22', '&quot;', $oauth);
</del><ins>+        $oauth = array(
+            'oauth_consumer_key' =&gt; $oauth_consumer_key,
+            'oauth_nonce' =&gt; $fields['oauth_nonce'],
+            'oauth_signature' =&gt; $signature,
+            'oauth_signature_method' =&gt; 'HMAC-SHA1',
+            'oauth_timestamp' =&gt; $fields['oauth_timestamp'],
+            'oauth_token' =&gt; $oauth_token,
+            'oauth_version' =&gt; '1.0',
+        );
+        $oauth = array_map(create_function('$h','return &quot;\&quot;$h\&quot;&quot;;'), $oauth);
</ins><span class="cx"> 
</span><del>-                $headers = array(
-                        'Authorization' =&gt; &quot;OAuth $oauth&quot;
-                );
</del><ins>+        $oauth = http_build_query($oauth, '', ', ');
+        $oauth = str_replace('%22', '&quot;', $oauth);
</ins><span class="cx"> 
</span><del>-                $options['headers'] = $headers;
-        
-                $response = wp_remote_get($endpoint, $options);
</del><ins>+        $headers = array(
+            'Authorization' =&gt; &quot;OAuth $oauth&quot;
+        );
</ins><span class="cx"> 
</span><del>-        if ( is_a($response, 'WP_Error') ) 
</del><ins>+        $options['headers'] = $headers;
+
+        $response = wp_remote_get($endpoint, $options);
+
+        if ( is_a($response, 'WP_Error') )
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-                if ( 200 == $response['response']['code'] &amp;&amp; ! empty($response['body']) ) {
-            $data = json_decode($response['body'])[0];
</del><ins>+        if ( 200 == $response['response']['code'] &amp;&amp; ! empty($response['body']) ) {
+            $body = json_decode($response['body']);
+            $data = $body[0];
</ins><span class="cx">             set_transient(self::CACHEKEY, json_encode($data), DAY_IN_SECONDS/2);
</span><span class="cx">             return $data;
</span><del>-                }
</del><ins>+        }
</ins><span class="cx"> 
</span><del>-                return false;
-        }
</del><ins>+        return false;
+    }
</ins><span class="cx"> 
</span><span class="cx"> } // END class WebKitTwitterTileWidget
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>