<!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>[45639] trunk: Code Modernisation: Fix known instances of array access on data types that can't be accessed as arrays.</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 { white-space: pre-line; 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="https://core.trac.wordpress.org/changeset/45639">45639</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/45639","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>pento</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-07-15 06:24:08 +0000 (Mon, 15 Jul 2019)</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'>Code Modernisation: Fix known instances of array access on data types that can't be accessed as arrays.
PHP 7.4 addes a warning when trying access a null/bool/int/float/resource (everything but array, string and object) as if it were an array.
This change fixes all of these warnings visible in unit tests.
Props jrf.
See <a href="https://core.trac.wordpress.org/ticket/47704">#47704</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizenavmenuitemsettingphp">trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php</a></li>
<li><a href="#trunksrcwpincludesmetaphp">trunk/src/wp-includes/meta.php</a></li>
<li><a href="#trunksrcwpincludesrestapiclasswprestrequestphp">trunk/src/wp-includes/rest-api/class-wp-rest-request.php</a></li>
<li><a href="#trunksrcwpincludesthemephp">trunk/src/wp-includes/theme.php</a></li>
<li><a href="#trunksrcwpincludesuserphp">trunk/src/wp-includes/user.php</a></li>
<li><a href="#trunksrcwpincludeswpdbphp">trunk/src/wp-includes/wp-db.php</a></li>
<li><a href="#trunktestsphpunittestsquerygeneratePostdataphp">trunk/tests/phpunit/tests/query/generatePostdata.php</a></li>
<li><a href="#trunktestsphpunitteststermtermExistsphp">trunk/tests/phpunit/tests/term/termExists.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasswpcustomizemanagerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-customize-manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-manager.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/src/wp-includes/class-wp-customize-manager.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5098,10 +5098,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'label' => __( 'Logo' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'section' => 'title_tagline',
</span><span class="cx" style="display: block; padding: 0 10px"> 'priority' => 8,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'height' => $custom_logo_args[0]['height'],
- 'width' => $custom_logo_args[0]['width'],
- 'flex_height' => $custom_logo_args[0]['flex-height'],
- 'flex_width' => $custom_logo_args[0]['flex-width'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'height' => isset( $custom_logo_args[0]['height'] ) ? $custom_logo_args[0]['height'] : null,
+ 'width' => isset( $custom_logo_args[0]['width'] ) ? $custom_logo_args[0]['width'] : null,
+ 'flex_height' => isset( $custom_logo_args[0]['flex-height'] ) ? $custom_logo_args[0]['flex-height'] : null,
+ 'flex_width' => isset( $custom_logo_args[0]['flex-width'] ) ? $custom_logo_args[0]['flex-width'] : null,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'button_labels' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'select' => __( 'Select logo' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'change' => __( 'Change logo' ),
</span></span></pre></div>
<a id="trunksrcwpincludescustomizeclasswpcustomizenavmenuitemsettingphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -477,8 +477,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_wp_get_nav_menu_items( $items, $menu, $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this_item = $this->value();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $current_nav_menu_term_id = $this_item['nav_menu_term_id'];
- unset( $this_item['nav_menu_term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $current_nav_menu_term_id = null;
+ if ( isset( $this_item['nav_menu_term_id'] ) ) {
+ $current_nav_menu_term_id = $this_item['nav_menu_term_id'];
+ unset( $this_item['nav_menu_term_id'] );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $should_filter = (
</span><span class="cx" style="display: block; padding: 0 10px"> $menu->term_id === $this->original_nav_menu_term_id
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -493,7 +496,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $should_remove = (
</span><span class="cx" style="display: block; padding: 0 10px"> false === $this_item
</span><span class="cx" style="display: block; padding: 0 10px"> ||
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- true === $this_item['_invalid']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ( isset( $this_item['_invalid'] ) && true === $this_item['_invalid'] )
</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"> $this->original_nav_menu_term_id === $menu->term_id
</span></span></pre></div>
<a id="trunksrcwpincludesmetaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/meta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/meta.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/src/wp-includes/meta.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -523,7 +523,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $meta_cache ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $meta_cache = $meta_cache[ $object_id ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $meta_cache[ $object_id ] ) ) {
+ $meta_cache = $meta_cache[ $object_id ];
+ } else {
+ $meta_cache = null;
+ }
</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 ( ! $meta_key ) {
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiclasswprestrequestphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/class-wp-rest-request.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/class-wp-rest-request.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/src/wp-includes/rest-api/class-wp-rest-request.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,7 +294,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array Map containing 'value' and 'parameters' keys.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array|null Map containing 'value' and 'parameters' keys
+ * or null when no valid content-type header was
+ * available.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_content_type() {
</span><span class="cx" style="display: block; padding: 0 10px"> $value = $this->get_header( 'content-type' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -334,7 +336,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $order = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $content_type = $this->get_content_type();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $content_type['value'] === 'application/json' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $content_type['value'] ) && 'application/json' === $content_type['value'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $order[] = 'JSON';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesthemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/src/wp-includes/theme.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2371,7 +2371,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Merge post types with any that already declared their support
</span><span class="cx" style="display: block; padding: 0 10px"> * for post thumbnails.
</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 ( is_array( $args[0] ) && isset( $_wp_theme_features['post-thumbnails'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $args[0] ) && is_array( $args[0] ) && isset( $_wp_theme_features['post-thumbnails'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $args[0] = array_unique( array_merge( $_wp_theme_features['post-thumbnails'][0], $args[0] ) );
</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">@@ -2378,7 +2378,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'post-formats':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_array( $args[0] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $args[0] ) && is_array( $args[0] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_formats = get_post_format_slugs();
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $post_formats['standard'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2391,7 +2391,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $args[0] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Build an array of types for back-compat.
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( ! is_array( $args[0] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( ! isset( $args[0] ) || ! is_array( $args[0] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> _doing_it_wrong( "add_theme_support( 'html5' )", __( 'You need to pass an array of types.' ), '3.6.1' );
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2403,7 +2403,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'custom-logo':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_array( $args ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true === $args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $args = array( 0 => array() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $defaults = array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2426,7 +2426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return add_theme_support( 'custom-header', array( 'uploads' => true ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'custom-header':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_array( $args ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true === $args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $args = array( 0 => array() );
</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">@@ -2516,7 +2516,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> case 'custom-background':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_array( $args ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true === $args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $args = array( 0 => array() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesuserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/user.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/src/wp-includes/user.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2088,7 +2088,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $logged_in_cookie = wp_parse_auth_cookie( '', 'logged_in' );
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/pluggable.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $default_cookie_life = apply_filters( 'auth_cookie_expiration', ( 2 * DAY_IN_SECONDS ), $ID, false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $remember = ( ( $logged_in_cookie['expiration'] - time() ) > $default_cookie_life );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $remember = false;
+ if ( false !== $logged_in_cookie && ( $logged_in_cookie['expiration'] - time() ) > $default_cookie_life ) {
+ $remember = true;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_set_auth_cookie( $ID, $remember );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludeswpdbphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/wp-db.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/wp-db.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/src/wp-includes/wp-db.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3113,7 +3113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $data as $col => $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $value['db'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // We're going to need to truncate by characters or bytes, depending on the length value we have.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'byte' === $value['length']['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $value['length']['type'] ) && 'byte' === $value['length']['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Using binary causes LEFT() to truncate by bytes.
</span><span class="cx" style="display: block; padding: 0 10px"> $charset = 'binary';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span></span></pre></div>
<a id="trunktestsphpunittestsquerygeneratePostdataphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/query/generatePostdata.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/query/generatePostdata.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/tests/phpunit/tests/query/generatePostdata.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,7 +24,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $data = generate_postdata( $fake->ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Fails because there's no post with this ID.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertNotSame( $fake->ID, $data['id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertFalse( $data );
</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"> /**
</span></span></pre></div>
<a id="trunktestsphpunitteststermtermExistsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/term/termExists.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/term/termExists.php 2019-07-15 05:13:10 UTC (rev 45638)
+++ trunk/tests/phpunit/tests/term/termExists.php 2019-07-15 06:24:08 UTC (rev 45639)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,7 +150,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _unregister_taxonomy( 'foo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( null, $found['term_id'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( null, $found );
</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"> public function test_term_exists_taxonomy_nonempty_parent_nonempty_match_name() {
</span></span></pre>
</div>
</div>
</body>
</html>