<!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>[55990] trunk/src: Code Modernization: Replace usage of `substr()` with `str_starts_with()` and `str_ends_with()`.</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/55990">55990</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/55990","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-06-22 14:55:47 +0000 (Thu, 22 Jun 2023)</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 Modernization: Replace usage of `substr()` with `str_starts_with()` and `str_ends_with()`.
`str_starts_with()` and `str_ends_with()` were introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins or ends with the given substring (needle).
WordPress core includes a polyfill for these functions on PHP < 8.0 as of WordPress 5.9.
This commit uses `str_starts_with()` and `str_ends_with()` in core files where appropriate:
* `$needle === substr( $string, 0, $length )`, where `$length` is the length of `$needle`, is replaced with `str_starts_with( $haystack, $needle )`.
* `$needle === substr( $string, $offset )`, where `$offset` is negative and the absolute value of `$offset` is the length of `$needle`, is replaced with `str_ends_with( $haystack, $needle )`.
This aims to make the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/52039">[52039]</a>, <a href="https://core.trac.wordpress.org/changeset/52040">[52040]</a>, <a href="https://core.trac.wordpress.org/changeset/52326">[52326]</a>, <a href="https://core.trac.wordpress.org/changeset/55703">[55703]</a>, <a href="https://core.trac.wordpress.org/changeset/55710">[55710]</a>, <a href="https://core.trac.wordpress.org/changeset/55987">[55987]</a>, <a href="https://core.trac.wordpress.org/changeset/55988">[55988]</a>.
Props Soean, spacedmonkey, Clorith, ocean90, azaozz, sabernhardt, SergeyBiryukov.
Fixes <a href="https://core.trac.wordpress.org/ticket/58220">#58220</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesclasscoreupgraderphp">trunk/src/wp-admin/includes/class-core-upgrader.php</a></li>
<li><a href="#trunksrcwpadminincludesclasslanguagepackupgraderphp">trunk/src/wp-admin/includes/class-language-pack-upgrader.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpscreenphp">trunk/src/wp-admin/includes/class-wp-screen.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpsitehealthautoupdatesphp">trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php</a></li>
<li><a href="#trunksrcwpadminincludesdeprecatedphp">trunk/src/wp-admin/includes/deprecated.php</a></li>
<li><a href="#trunksrcwpadminincludesfilephp">trunk/src/wp-admin/includes/file.php</a></li>
<li><a href="#trunksrcwpadminincludesmediaphp">trunk/src/wp-admin/includes/media.php</a></li>
<li><a href="#trunksrcwpadminincludesmiscphp">trunk/src/wp-admin/includes/misc.php</a></li>
<li><a href="#trunksrcwpadminincludespluginphp">trunk/src/wp-admin/includes/plugin.php</a></li>
<li><a href="#trunksrcwpadminincludesupdatecorephp">trunk/src/wp-admin/includes/update-core.php</a></li>
<li><a href="#trunksrcwpadminsetupconfigphp">trunk/src/wp-admin/setup-config.php</a></li>
<li><a href="#trunksrcwpadminwidgetsformphp">trunk/src/wp-admin/widgets-form.php</a></li>
<li><a href="#trunksrcwpincludesbookmarktemplatephp">trunk/src/wp-includes/bookmark-template.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizenavmenusphp">trunk/src/wp-includes/class-wp-customize-nav-menus.php</a></li>
<li><a href="#trunksrcwpincludesclasswpembedphp">trunk/src/wp-includes/class-wp-embed.php</a></li>
<li><a href="#trunksrcwpincludesclasswphttpcookiephp">trunk/src/wp-includes/class-wp-http-cookie.php</a></li>
<li><a href="#trunksrcwpincludesclasswphttpencodingphp">trunk/src/wp-includes/class-wp-http-encoding.php</a></li>
<li><a href="#trunksrcwpincludesclasswpnetworkphp">trunk/src/wp-includes/class-wp-network.php</a></li>
<li><a href="#trunksrcwpincludesclasswpdbphp">trunk/src/wp-includes/class-wpdb.php</a></li>
<li><a href="#trunksrcwpincludescommenttemplatephp">trunk/src/wp-includes/comment-template.php</a></li>
<li><a href="#trunksrcwpincludesdeprecatedphp">trunk/src/wp-includes/deprecated.php</a></li>
<li><a href="#trunksrcwpincludesformattingphp">trunk/src/wp-includes/formatting.php</a></li>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunksrcwpincludeshttpphp">trunk/src/wp-includes/http.php</a></li>
<li><a href="#trunksrcwpincludesksesphp">trunk/src/wp-includes/kses.php</a></li>
<li><a href="#trunksrcwpincludesl10nphp">trunk/src/wp-includes/l10n.php</a></li>
<li><a href="#trunksrcwpincludesloadphp">trunk/src/wp-includes/load.php</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
<li><a href="#trunksrcwpincludesmsblogsphp">trunk/src/wp-includes/ms-blogs.php</a></li>
<li><a href="#trunksrcwpincludesmsdeprecatedphp">trunk/src/wp-includes/ms-deprecated.php</a></li>
<li><a href="#trunksrcwpincludesmsloadphp">trunk/src/wp-includes/ms-load.php</a></li>
<li><a href="#trunksrcwpincludesmssettingsphp">trunk/src/wp-includes/ms-settings.php</a></li>
<li><a href="#trunksrcwpincludespluggablephp">trunk/src/wp-includes/pluggable.php</a></li>
<li><a href="#trunksrcwpincludespomopophp">trunk/src/wp-includes/pomo/po.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludesshortcodesphp">trunk/src/wp-includes/shortcodes.php</a></li>
<li><a href="#trunksrcwpincludesuserphp">trunk/src/wp-includes/user.php</a></li>
<li><a href="#trunksrcwpincludesvarsphp">trunk/src/wp-includes/vars.php</a></li>
<li><a href="#trunksrcwpincludeswidgetsphp">trunk/src/wp-includes/widgets.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/ajax-actions.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3323,7 +3323,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' );
</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 ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $post->post_mime_type, 'image' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $align = isset( $attachment['align'] ) ? $attachment['align'] : 'none';
</span><span class="cx" style="display: block; padding: 0 10px"> $size = isset( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';
</span><span class="cx" style="display: block; padding: 0 10px"> $alt = isset( $attachment['image_alt'] ) ? $attachment['image_alt'] : '';
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasscoreupgraderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-core-upgrader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-core-upgrader.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/class-core-upgrader.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -405,7 +405,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $checksums as $file => $checksum ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Skip files which get updated.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'wp-content' === substr( $file, 0, 10 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $file, 'wp-content' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! file_exists( ABSPATH . $file ) || md5_file( ABSPATH . $file ) !== $checksum ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasslanguagepackupgraderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-language-pack-upgrader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-language-pack-upgrader.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/class-language-pack-upgrader.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -336,9 +336,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $po = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $mo = false;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $files as $file => $filedata ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.po' === substr( $file, -3 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $file, '.po' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $po = true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( '.mo' === substr( $file, -3 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( str_ends_with( $file, '.mo' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $mo = true;
</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="trunksrcwpadminincludesclasswpscreenphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-screen.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-screen.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/class-wp-screen.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -230,7 +230,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type = $id;
</span><span class="cx" style="display: block; padding: 0 10px"> $id = 'post'; // Changes later. Ends up being $base.
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.php' === substr( $id, -4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $id, '.php' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $id = substr( $id, 0, -4 );
</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">@@ -241,16 +241,16 @@
</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 ( ! $post_type && $hook_name ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '-network' === substr( $id, -8 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $id, '-network' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $id = substr( $id, 0, -8 );
</span><span class="cx" style="display: block; padding: 0 10px"> $in_admin = 'network';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( '-user' === substr( $id, -5 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( str_ends_with( $id, '-user' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $id = substr( $id, 0, -5 );
</span><span class="cx" style="display: block; padding: 0 10px"> $in_admin = 'user';
</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"> $id = sanitize_key( $id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'edit-comments' !== $id && 'edit-tags' !== $id && 'edit-' === substr( $id, 0, 5 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'edit-comments' !== $id && 'edit-tags' !== $id && str_starts_with( $id, 'edit-' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $maybe = substr( $id, 5 );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( taxonomy_exists( $maybe ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $id = 'edit-tags';
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpsitehealthautoupdatesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -358,7 +358,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $unwritable_files = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array_keys( $checksums ) as $file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'wp-content' === substr( $file, 0, 10 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $file, 'wp-content' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! file_exists( ABSPATH . $file ) ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/deprecated.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/deprecated.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1365,7 +1365,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Is this random plugin's slug already installed? If so, try again.
</span><span class="cx" style="display: block; padding: 0 10px"> reset( $plugin_slugs );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $plugin_slugs as $plugin_slug ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $slug === substr( $plugin_slug, 0, strlen( $slug ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $plugin_slug, $slug ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $items[$item_key] );
</span><span class="cx" style="display: block; padding: 0 10px"> continue 2;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesfilephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/file.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/file.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/file.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1253,7 +1253,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $signature_url = false;
</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_string( $url_path ) && ( '.zip' === substr( $url_path, -4 ) || '.tar.gz' === substr( $url_path, -7 ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_string( $url_path ) && ( str_ends_with( $url_path, '.zip' ) || str_ends_with( $url_path, '.tar.gz' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $signature_url = str_replace( $url_path, $url_path . '.sig', $url );
</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">@@ -1646,7 +1646,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
</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 ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $info['name'], '__MACOSX/' ) ) { // Skip the OS X-created __MACOSX directory.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">@@ -1659,7 +1659,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $dirname = dirname( $info['name'] );
</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 ( '/' === substr( $info['name'], -1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $info['name'], '/' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Directory.
</span><span class="cx" style="display: block; padding: 0 10px"> $needed_dirs[] = $to . untrailingslashit( $info['name'] );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( '.' !== $dirname ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1726,11 +1726,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'stat_failed_ziparchive', __( 'Could not retrieve file from archive.' ) );
</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 ( '/' === substr( $info['name'], -1 ) ) { // Directory.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $info['name'], '/' ) ) { // Directory.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 ( '__MACOSX/' === substr( $info['name'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $info['name'], '__MACOSX/' ) ) { // Don't extract the OS X-created __MACOSX directory files.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">@@ -1800,7 +1800,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Determine any children directories needed (From within the archive).
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $archive_files as $file ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Skip the OS X-created __MACOSX directory.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $file['filename'], '__MACOSX/' ) ) { // Skip the OS X-created __MACOSX directory.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">@@ -1866,7 +1866,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 ( '__MACOSX/' === substr( $file['filename'], 0, 9 ) ) { // Don't extract the OS X-created __MACOSX directory files.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $file['filename'], '__MACOSX/' ) ) { // Don't extract the OS X-created __MACOSX directory files.
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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="trunksrcwpadminincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/media.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/media.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1354,7 +1354,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function image_media_send_to_editor( $html, $attachment_id, $attachment ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $attachment_id );
</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 ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $post->post_mime_type, 'image' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $url = $attachment['url'];
</span><span class="cx" style="display: block; padding: 0 10px"> $align = ! empty( $attachment['align'] ) ? $attachment['align'] : 'none';
</span><span class="cx" style="display: block; padding: 0 10px"> $size = ! empty( $attachment['image-size'] ) ? $attachment['image-size'] : 'medium';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1465,7 +1465,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $form_fields = array_merge_recursive( $form_fields, (array) $errors );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // This was formerly in image_attachment_fields_to_edit().
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $post->post_mime_type, 'image' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $alt = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $alt ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3220,7 +3220,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wp_attachment_details edit-form-section">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( str_starts_with( $post->post_mime_type, 'image' ) ) : ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <p class="attachment-alt-text">
</span><span class="cx" style="display: block; padding: 0 10px"> <label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br />
</span><span class="cx" style="display: block; padding: 0 10px"> <textarea class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" aria-describedby="alt-text-description"><?php echo esc_attr( $alt_text ); ?></textarea>
</span></span></pre></div>
<a id="trunksrcwpadminincludesmiscphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/misc.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/misc.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/misc.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,7 +81,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 ( $state ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '#' === substr( $markerline, 0, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $markerline, '#' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">@@ -750,7 +750,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><span class="cx" style="display: block; padding: 0 10px"> $screen_option = false;
</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 ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $option, '_page' ) || 'layout_columns' === $option ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters a screen option value before it is set.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunksrcwpadminincludespluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/plugin.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/plugin.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,7 +294,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $plugins_dir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.' === substr( $file, 0, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $file, '.' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">@@ -303,11 +303,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $plugins_subdir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> while ( ( $subfile = readdir( $plugins_subdir ) ) !== false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.' === substr( $subfile, 0, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $subfile, '.' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 ( '.php' === substr( $subfile, -4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $subfile, '.php' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $plugin_files[] = "$file/$subfile";
</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">@@ -315,7 +315,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> closedir( $plugins_subdir );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.php' === substr( $file, -4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $file, '.php' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $plugin_files[] = $file;
</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">@@ -371,7 +371,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $plugins_dir = @opendir( WPMU_PLUGIN_DIR );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $plugins_dir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> while ( ( $file = readdir( $plugins_dir ) ) !== false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.php' === substr( $file, -4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $file, '.php' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $plugin_files[] = $file;
</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="trunksrcwpadminincludesupdatecorephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/update-core.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/update-core.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/includes/update-core.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1242,7 +1242,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $checksums ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $checksums as $file => $checksum ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'wp-content' === substr( $file, 0, 10 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $file, 'wp-content' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">@@ -1349,7 +1349,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $checksums ) && is_array( $checksums ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $checksums as $file => $checksum ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'wp-content' === substr( $file, 0, 10 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $file, 'wp-content' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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="trunksrcwpadminsetupconfigphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/setup-config.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/setup-config.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/setup-config.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,7 +363,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $key = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $config_file as $line_num => $line ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '$table_prefix =' === substr( $line, 0, 15 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $line, '$table_prefix =' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminwidgetsformphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/widgets-form.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/widgets-form.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-admin/widgets-form.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -301,7 +301,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'wp_inactive_widgets' === $sbname || 'orphaned_widgets' === substr( $sbname, 0, 16 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'wp_inactive_widgets' === $sbname || str_starts_with( $sbname, 'orphaned_widgets' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo ' ';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -450,7 +450,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $theme_sidebars = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( str_contains( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_contains( $registered_sidebar['class'], 'inactive-sidebar' ) || str_starts_with( $sidebar, 'orphaned_widgets' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $wrap_class = 'widgets-holder-wrap';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $registered_sidebar['class'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $wrap_class .= ' ' . $registered_sidebar['class'];
</span></span></pre></div>
<a id="trunksrcwpincludesbookmarktemplatephp"></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/bookmark-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/bookmark-template.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/bookmark-template.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,7 +83,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $title = $desc;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $parsed_args['show_updated'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '00' !== substr( $bookmark->link_updated_f, 0, 2 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_starts_with( $bookmark->link_updated_f, '00' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $title .= ' (';
</span><span class="cx" style="display: block; padding: 0 10px"> $title .= sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Date and time of last update. */
</span></span></pre></div>
<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 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/class-wp-customize-manager.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6076,7 +6076,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'This video file is too large to use as a header video. Try a shorter video or optimize the compression settings and re-upload a file that is less than 8MB. Or, upload your video to YouTube and link it with the option below.' )
</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 ( '.mp4' !== substr( $video, -4 ) && '.mov' !== substr( $video, -4 ) ) { // Check for .mp4 or .mov format, which (assuming h.264 encoding) are the only cross-browser-supported formats.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_ends_with( $video, '.mp4' ) && ! str_ends_with( $video, '.mov' ) ) { // Check for .mp4 or .mov format, which (assuming h.264 encoding) are the only cross-browser-supported formats.
</ins><span class="cx" style="display: block; padding: 0 10px"> $validity->add(
</span><span class="cx" style="display: block; padding: 0 10px"> 'invalid_file_type',
</span><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizenavmenusphp"></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-nav-menus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-nav-menus.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/class-wp-customize-nav-menus.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1472,7 +1472,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (
</span><span class="cx" style="display: block; padding: 0 10px"> ! empty( $args['container'] )
</span><span class="cx" style="display: block; padding: 0 10px"> ||
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ( isset( $args['items_wrap'] ) && '<' === substr( $args['items_wrap'], 0, 1 ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ( isset( $args['items_wrap'] ) && str_starts_with( $args['items_wrap'], '<' ) )
</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"> $args['can_partial_refresh'] = $can_partial_refresh;
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpembedphp"></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-embed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-embed.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/class-wp-embed.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -388,7 +388,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"> foreach ( $post_metas as $post_meta_key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '_oembed_' === substr( $post_meta_key, 0, 8 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $post_meta_key, '_oembed_' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> delete_post_meta( $post_id, $post_meta_key );
</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="trunksrcwpincludesclasswphttpcookiephp"></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-http-cookie.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-http-cookie.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/class-wp-http-cookie.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->domain = $parsed_url['host'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $this->path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : '/';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '/' !== substr( $this->path, -1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_ends_with( $this->path, '/' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->path = dirname( $this->path ) . '/';
</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">@@ -202,7 +202,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"> // Host - very basic check that the request URL ends with the domain restriction (minus leading dot).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $domain = ( '.' === substr( $domain, 0, 1 ) ) ? substr( $domain, 1 ) : $domain;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $domain = ( str_starts_with( $domain, '.' ) ) ? substr( $domain, 1 ) : $domain;
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( substr( $url['host'], -strlen( $domain ) ) !== $domain ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesclasswphttpencodingphp"></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-http-encoding.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-http-encoding.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/class-wp-http-encoding.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,7 +104,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public static function compatible_gzinflate( $gz_data ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Compressed data might contain a full header, if so strip it for gzinflate().
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( "\x1f\x8b\x08" === substr( $gz_data, 0, 3 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $gz_data, "\x1f\x8b\x08" ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $i = 10;
</span><span class="cx" style="display: block; padding: 0 10px"> $flg = ord( substr( $gz_data, 3, 1 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $flg > 0 ) {
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpnetworkphp"></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-network.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-network.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/class-wp-network.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -306,7 +306,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"> $this->cookie_domain = $this->domain;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'www.' === substr( $this->cookie_domain, 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $this->cookie_domain, 'www.' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->cookie_domain = substr( $this->cookie_domain, 4 );
</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="trunksrcwpincludesclasswpdbphp"></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-wpdb.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wpdb.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/class-wpdb.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1564,7 +1564,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $type = substr( $placeholder, -1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'f' === $type && true === $this->allow_unsafe_unquoted_parameters
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- && '%' === substr( $split_query[ $key - 1 ], -1, 1 )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ && str_ends_with( $split_query[ $key - 1 ], '%' )
</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 class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1625,7 +1625,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Second, if "%s" has a "%" before it, even if it's unrelated (e.g. "LIKE '%%%s%%'").
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( true !== $this->allow_unsafe_unquoted_parameters
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- || ( '' === $format && '%' !== substr( $split_query[ $key - 1 ], -1, 1 ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ || ( '' === $format && ! str_ends_with( $split_query[ $key - 1 ], '%' ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $placeholder = "'%" . $format . "s'";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludescommenttemplatephp"></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/comment-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment-template.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/comment-template.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -425,7 +425,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $display = str_replace( 'http://www.', '', $display );
</span><span class="cx" style="display: block; padding: 0 10px"> $display = str_replace( 'http://', '', $display );
</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 ( '/' === substr( $display, -1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $display, '/' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $display = substr( $display, 0, -1 );
</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="trunksrcwpincludesdeprecatedphp"></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/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/deprecated.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/deprecated.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1042,7 +1042,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle link category sorting.
</span><span class="cx" style="display: block; padding: 0 10px"> $direction = 'ASC';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '_' === substr($order,0,1) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $order, '_' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $direction = 'DESC';
</span><span class="cx" style="display: block; padding: 0 10px"> $order = substr($order,1);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesformattingphp"></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/formatting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/formatting.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/formatting.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,7 +242,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Only call _wptexturize_pushpop_element if $curl is a delimiter.
</span><span class="cx" style="display: block; padding: 0 10px"> $first = $curl[0];
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '<' === $first ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '<!--' === substr( $curl, 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $curl, '<!--' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // This is an HTML comment delimiter.
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -260,7 +260,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( '[' === $first && $found_shortcodes && 1 === preg_match( '/^' . $shortcode_regex . '$/', $curl ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // This is a shortcode delimiter.
</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 ( '[[' !== substr( $curl, 0, 2 ) && ']]' !== substr( $curl, -2 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_starts_with( $curl, '[[' ) && ! str_ends_with( $curl, ']]' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Looks like a normal shortcode.
</span><span class="cx" style="display: block; padding: 0 10px"> _wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2627,7 +2627,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $is_single_tag = in_array( $tag, $single_tags, true );
</span><span class="cx" style="display: block; padding: 0 10px"> $pre_attribute_ws = isset( $regex[4] ) ? $regex[4] : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $attributes = trim( isset( $regex[5] ) ? $regex[5] : $regex[3] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $has_self_closer = '/' === substr( $attributes, -1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $has_self_closer = str_ends_with( $attributes, '/' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $newtext .= $tagqueue;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3693,7 +3693,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'Z' === $timezone ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $offset = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $sign = ( '+' === substr( $timezone, 0, 1 ) ) ? 1 : -1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $sign = ( str_starts_with( $timezone, '+' ) ) ? 1 : -1;
</ins><span class="cx" style="display: block; padding: 0 10px"> $hours = (int) substr( $timezone, 1, 2 );
</span><span class="cx" style="display: block; padding: 0 10px"> $minutes = (int) substr( $timezone, 3, 4 ) / 60;
</span><span class="cx" style="display: block; padding: 0 10px"> $offset = $sign * HOUR_IN_SECONDS * ( $hours + $minutes );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5266,7 +5266,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_sprintf_l( $pattern, $args ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Not a match.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '%l' !== substr( $pattern, 0, 2 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_starts_with( $pattern, '%l' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $pattern;
</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="trunksrcwpincludesfunctionsphp"></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/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/functions.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -513,7 +513,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $duration = trim( $duration );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove prepended negative sign.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '-' === substr( $duration, 0, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $duration, '-' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $duration = substr( $duration, 1 );
</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">@@ -743,7 +743,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ':' !== $data[1] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( ';' !== substr( $data, -1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( ! str_ends_with( $data, ';' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 's' !== $data[0] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6361,17 +6361,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't use translated versions of Etc.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'Etc' === $a['continent'] && 'Etc' === $b['continent'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Make the order of these more like the old dropdown.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'GMT+' === substr( $a['city'], 0, 4 ) && 'GMT+' === substr( $b['city'], 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $a['city'], 'GMT+' ) && str_starts_with( $b['city'], 'GMT+' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return -1 * ( strnatcasecmp( $a['city'], $b['city'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'UTC' === $a['city'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'GMT+' === substr( $b['city'], 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $b['city'], 'GMT+' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 1;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return -1;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'UTC' === $b['city'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'GMT+' === substr( $a['city'], 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $a['city'], 'GMT+' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return -1;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return 1;
</span></span></pre></div>
<a id="trunksrcwpincludeshttpphp"></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/http.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/http.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/http.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -694,10 +694,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $to_unset = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $url = (string) $url;
</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 ( '//' === substr( $url, 0, 2 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $url, '//' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $to_unset[] = 'scheme';
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'placeholder:' . $url;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( '/' === substr( $url, 0, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( str_starts_with( $url, '/' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $to_unset[] = 'scheme';
</span><span class="cx" style="display: block; padding: 0 10px"> $to_unset[] = 'host';
</span><span class="cx" style="display: block; padding: 0 10px"> $url = 'placeholder://placeholder' . $url;
</span></span></pre></div>
<a id="trunksrcwpincludesksesphp"></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/kses.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/kses.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/kses.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1079,12 +1079,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = wp_kses_stripslashes( $content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // It matched a ">" character.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '<' !== substr( $content, 0, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_starts_with( $content, '<' ) ) {
</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="cx" style="display: block; padding: 0 10px"> // Allow HTML comments.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '<!--' === substr( $content, 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $content, '<!--' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $content = str_replace( array( '<!--', '-->' ), '', $content );
</span><span class="cx" style="display: block; padding: 0 10px"> while ( ( $newstring = wp_kses( $content, $allowed_html, $allowed_protocols ) ) != $content ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = $newstring;
</span></span></pre></div>
<a id="trunksrcwpincludesl10nphp"></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/l10n.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/l10n.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/l10n.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1181,7 +1181,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"> // Translations are always based on the unminified filename.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( substr( $relative, -7 ) === '.min.js' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $relative, '.min.js' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $relative = substr( $relative, 0, -7 ) . '.js';
</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">@@ -1454,7 +1454,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '.' === $file[0] || is_dir( WP_LANG_DIR . "$dir/$file" ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 ( substr( $file, -3 ) !== '.po' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_ends_with( $file, '.po' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?).po/', $file, $match ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesloadphp"></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/load.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/load.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/load.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -835,7 +835,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $mu_plugins;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> while ( ( $plugin = readdir( $dh ) ) !== false ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.php' === substr( $plugin, -4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $plugin, '.php' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin;
</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="trunksrcwpincludesmediaphp"></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/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/media.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/media.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1324,7 +1324,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * If currently on HTTPS, prefer HTTPS URLs when we know they're supported by the domain
</span><span class="cx" style="display: block; padding: 0 10px"> * (which is to say, when they share the domain name of the current request).
</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_ssl() && 'https' !== substr( $image_baseurl, 0, 5 ) && parse_url( $image_baseurl, PHP_URL_HOST ) === $_SERVER['HTTP_HOST'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_ssl() && ! str_starts_with( $image_baseurl, 'https' ) && parse_url( $image_baseurl, PHP_URL_HOST ) === $_SERVER['HTTP_HOST'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $image_baseurl = set_url_scheme( $image_baseurl, 'https' );
</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="trunksrcwpincludesmsblogsphp"></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/ms-blogs.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-blogs.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/ms-blogs.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,7 +137,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false !== $blog ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $blog;
</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 ( 'www.' === substr( $fields['domain'], 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $fields['domain'], 'www.' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $nowww = substr( $fields['domain'], 4 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) AND path = %s ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'], $fields['path'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -155,7 +155,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false !== $blog ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $blog;
</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 ( 'www.' === substr( $fields['domain'], 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $fields['domain'], 'www.' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $nowww = substr( $fields['domain'], 4 );
</span><span class="cx" style="display: block; padding: 0 10px"> $blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain IN (%s,%s) ORDER BY CHAR_LENGTH(domain) DESC", $nowww, $fields['domain'] ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span></span></pre></div>
<a id="trunksrcwpincludesmsdeprecatedphp"></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/ms-deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-deprecated.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/ms-deprecated.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -295,7 +295,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['redirect'] ) && isset( $_POST['redirect'] ) && $_GET['redirect'] !== $_POST['redirect'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['redirect'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 's_' === substr( $_GET['redirect'], 0, 2 ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $_GET['redirect'], 's_' ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> $url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_POST['redirect'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] );
</span></span></pre></div>
<a id="trunksrcwpincludesmsloadphp"></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/ms-load.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-load.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/ms-load.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,7 +46,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $active_plugins as $plugin ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! validate_file( $plugin ) // $plugin must validate as file.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- && '.php' === substr( $plugin, -4 ) // $plugin must end with '.php'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ && str_ends_with( $plugin, '.php' ) // $plugin must end with '.php'.
</ins><span class="cx" style="display: block; padding: 0 10px"> && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist.
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,7 +229,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Either www or non-www is supported, not both. If a www domain is requested,
</span><span class="cx" style="display: block; padding: 0 10px"> // query for both to provide the proper redirect.
</span><span class="cx" style="display: block; padding: 0 10px"> $domains = array( $domain );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'www.' === substr( $domain, 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $domain, 'www.' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $domains[] = substr( $domain, 4 );
</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="trunksrcwpincludesmssettingsphp"></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/ms-settings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-settings.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/ms-settings.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,10 +55,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $current_site ) || ! isset( $current_blog ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $domain = strtolower( stripslashes( $_SERVER['HTTP_HOST'] ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ':80' === substr( $domain, -3 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $domain, ':80' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $domain = substr( $domain, 0, -3 );
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -3 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( ':443' === substr( $domain, -4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( str_ends_with( $domain, ':443' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $domain = substr( $domain, 0, -4 );
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludespluggablephp"></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/pluggable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/pluggable.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/pluggable.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -376,7 +376,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $from_email = 'wordpress@';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( null !== $sitename ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'www.' === substr( $sitename, 0, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $sitename, 'www.' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $sitename = substr( $sitename, 4 );
</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">@@ -1557,7 +1557,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_validate_redirect( $location, $fallback_url = '' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $location = wp_sanitize_redirect( trim( $location, " \t\n\r\0\x08\x0B" ) );
</span><span class="cx" style="display: block; padding: 0 10px"> // Browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '//' === substr( $location, 0, 2 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $location, '//' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $location = 'http:' . $location;
</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="trunksrcwpincludespomopophp"></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/pomo/po.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/pomo/po.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/pomo/po.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -505,10 +505,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function trim_quotes( $s ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '"' === substr( $s, 0, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $s, '"' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $s = substr( $s, 1 );
</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 ( '"' === substr( $s, -1, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $s, '"' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $s = substr( $s, 0, -1 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $s;
</span></span></pre></div>
<a id="trunksrcwpincludespostphp"></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/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/post.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6762,7 +6762,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $dh ) {
</span><span class="cx" style="display: block; padding: 0 10px"> while ( false !== $file = readdir( $dh ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = wp_basename( $file );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.' === substr( $file, 0, 1 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $file, '.' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">@@ -7813,7 +7813,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $post = get_post( $post );
</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 ( '__trashed' === substr( $post->post_name, -9 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $post->post_name, '__trashed' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $post->post_name;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_post_meta( $post->ID, '_wp_desired_post_slug', $post->post_name );
</span></span></pre></div>
<a id="trunksrcwpincludesshortcodesphp"></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/shortcodes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/shortcodes.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/shortcodes.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -423,7 +423,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 ( $ignore_html || '<!--' === substr( $element, 0, 4 ) || '<![CDATA[' === substr( $element, 0, 9 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $ignore_html || str_starts_with( $element, '<!--' ) || str_starts_with( $element, '<![CDATA[' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Encode all '[' and ']' chars.
</span><span class="cx" style="display: block; padding: 0 10px"> $element = strtr( $element, $trans );
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</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 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/user.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -986,7 +986,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $keys );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $keys as $key ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'capabilities' !== substr( $key, -12 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_ends_with( $key, 'capabilities' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $wpdb->base_prefix && ! str_starts_with( $key, $wpdb->base_prefix ) ) {
</span></span></pre></div>
<a id="trunksrcwpincludesvarsphp"></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/vars.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/vars.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/vars.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,7 +39,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> preg_match( '#(.*?)(/|$)#', $pagenow, $self_matches );
</span><span class="cx" style="display: block; padding: 0 10px"> $pagenow = strtolower( $self_matches[1] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '.php' !== substr( $pagenow, -4, 4 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! str_ends_with( $pagenow, '.php' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $pagenow .= '.php'; // For `Options +Multiviews`: /wp-admin/themes/index.php (themes.php is queried).
</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="trunksrcwpincludeswidgetsphp"></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/widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/widgets.php 2023-06-22 14:35:23 UTC (rev 55989)
+++ trunk/src/wp-includes/widgets.php 2023-06-22 14:55:47 UTC (rev 55990)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -908,7 +908,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $sidebars_widgets ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $sidebars_widgets as $sidebar => $widgets ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $skip_inactive && ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $skip_inactive && ( 'wp_inactive_widgets' === $sidebar || str_starts_with( $sidebar, 'orphaned_widgets' ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</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">@@ -1382,7 +1382,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"> foreach ( $existing_sidebars_widgets as $sidebar => $widgets ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'wp_inactive_widgets' === $sidebar || str_starts_with( $sidebar, 'orphaned_widgets' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $new_sidebars_widgets['wp_inactive_widgets'] = array_merge( $new_sidebars_widgets['wp_inactive_widgets'], (array) $widgets );
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $existing_sidebars_widgets[ $sidebar ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1490,7 +1490,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove orphaned widgets, we're only interested in previously active sidebars.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $old_sidebars_widgets as $sidebar => $widgets ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_starts_with( $sidebar, 'orphaned_widgets' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $old_sidebars_widgets[ $sidebar ] );
</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">@@ -1627,7 +1627,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $summary = $desc;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Change existing [...] to […].
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '[...]' === substr( $summary, -5 ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( str_ends_with( $summary, '[...]' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $summary = substr( $summary, 0, -5 ) . '[…]';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>