<!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>[58409] trunk: Code Modernization: Use wp_trigger_error() instead of trigger_error().</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/58409">58409</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/58409","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>hellofromTonya</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-06-13 20:48:33 +0000 (Thu, 13 Jun 2024)</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: Use wp_trigger_error() instead of trigger_error().
Replaces `trigger_error()` with `wp_trigger_error()`.
The usage of `wp_trigger_error()` avoids generating `E_USER` family errors unless `WP_DEBUG` is on. In doing so, users should not see these messages in normal production.
Notes:
* Removes `E_USER_NOTICE` when passed as an argumnent, as it's the default error level.
* An empty string is passed for the function name when its name is already in the error message or does not add value to the error message.
* Externally maintained libraries are not included.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/55204">[55204]</a>, <a href="https://core.trac.wordpress.org/changeset/25956">[25956]</a>, <a href="https://core.trac.wordpress.org/changeset/29630">[29630]</a>, <a href="https://core.trac.wordpress.org/changeset/38883">[38883]</a>, <a href="https://core.trac.wordpress.org/changeset/52062">[52062]</a>, <a href="https://core.trac.wordpress.org/changeset/52049">[52049]</a>, <a href="https://core.trac.wordpress.org/changeset/54272">[54272]</a>, <a href="https://core.trac.wordpress.org/changeset/38883">[38883]</a>, <a href="https://core.trac.wordpress.org/changeset/55245">[55245]</a>, <a href="https://core.trac.wordpress.org/changeset/51599">[51599]</a>, <a href="https://core.trac.wordpress.org/changeset/14452">[14452]</a>, <a href="https://core.trac.wordpress.org/changeset/38883">[38883]</a>, <a href="https://core.trac.wordpress.org/changeset/24976">[24976]</a>.
Props prasadkarmalkar, rajinsharwar, thelovekesh, hellofromTonya, swissspidy.
Fixes <a href="https://core.trac.wordpress.org/ticket/59652">#59652</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesfilephp">trunk/src/wp-admin/includes/file.php</a></li>
<li><a href="#trunksrcwpadminincludesplugininstallphp">trunk/src/wp-admin/includes/plugin-install.php</a></li>
<li><a href="#trunksrcwpadminincludesthemephp">trunk/src/wp-admin/includes/theme.php</a></li>
<li><a href="#trunksrcwpadminincludestranslationinstallphp">trunk/src/wp-admin/includes/translation-install.php</a></li>
<li><a href="#trunksrcwpadminincludesupdatephp">trunk/src/wp-admin/includes/update.php</a></li>
<li><a href="#trunksrcwpadminlinkparseopmlphp">trunk/src/wp-admin/link-parse-opml.php</a></li>
<li><a href="#trunksrcwpincludesblocktemplateutilsphp">trunk/src/wp-includes/block-template-utils.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemejsonresolverphp">trunk/src/wp-includes/class-wp-theme-json-resolver.php</a></li>
<li><a href="#trunksrcwpincludesclasswpthemejsonphp">trunk/src/wp-includes/class-wp-theme-json.php</a></li>
<li><a href="#trunksrcwpincludesfeedphp">trunk/src/wp-includes/feed.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="#trunksrcwpincludesmsdefaultconstantsphp">trunk/src/wp-includes/ms-default-constants.php</a></li>
<li><a href="#trunksrcwpincludesrssphp">trunk/src/wp-includes/rss.php</a></li>
<li><a href="#trunksrcwpincludesthemephp">trunk/src/wp-includes/theme.php</a></li>
<li><a href="#trunksrcwpincludesupdatephp">trunk/src/wp-includes/update.php</a></li>
<li><a href="#trunktestsphpunittestsfilesystemwpOpcacheInvalidateDirectoryphp">trunk/tests/phpunit/tests/filesystem/wpOpcacheInvalidateDirectory.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<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 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-admin/includes/file.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2795,7 +2795,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> __( '%s expects a non-empty string.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>wp_opcache_invalidate_directory()</code>'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( $error_message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( '', $error_message );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesplugininstallphp"></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-install.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/plugin-install.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-admin/includes/plugin-install.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,7 +174,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ssl && is_wp_error( $request ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! wp_is_json_request() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Support forums URL. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
</span></span></pre></div>
<a id="trunksrcwpadminincludesthemephp"></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/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/theme.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-admin/includes/theme.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -568,7 +568,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ssl && is_wp_error( $request ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! wp_doing_ajax() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Support forums URL. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
</span></span></pre></div>
<a id="trunksrcwpadminincludestranslationinstallphp"></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/translation-install.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/translation-install.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-admin/includes/translation-install.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $request = wp_remote_post( $url, $options );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ssl && is_wp_error( $request ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Support forums URL. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
</span></span></pre></div>
<a id="trunksrcwpadminincludesupdatephp"></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.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/update.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-admin/includes/update.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,7 +145,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wp_remote_get( $url, $options );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ssl && is_wp_error( $response ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Support forums URL. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
</span></span></pre></div>
<a id="trunksrcwpadminlinkparseopmlphp"></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/link-parse-opml.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/link-parse-opml.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-admin/link-parse-opml.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,7 +78,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Create an XML parser.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! function_exists( 'xml_parser_create' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( '', __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> wp_die( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
</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="trunksrcwpincludesblocktemplateutilsphp"></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/block-template-utils.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/block-template-utils.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/block-template-utils.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,7 +252,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $type,
</span><span class="cx" style="display: block; padding: 0 10px"> WP_TEMPLATE_PART_AREA_UNCATEGORIZED
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( $warning_message, E_USER_NOTICE );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( __FUNCTION__, $warning_message );
</ins><span class="cx" style="display: block; padding: 0 10px"> return WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
</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="trunksrcwpincludesclasswpthemejsonresolverphp"></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-theme-json-resolver.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme-json-resolver.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/class-wp-theme-json-resolver.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -504,7 +504,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $json_decoding_error = json_last_error();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( JSON_ERROR_NONE !== $json_decoding_error ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( 'Error when decoding a theme.json schema for user data. ' . json_last_error_msg() );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( __METHOD__, 'Error when decoding a theme.json schema for user data. ' . json_last_error_msg() );
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the data provided by the user for global styles & settings.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpthemejsonphp"></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-theme-json.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-theme-json.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/class-wp-theme-json.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3775,7 +3775,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> || ! is_numeric( $spacing_scale['mediumStep'] )
</span><span class="cx" style="display: block; padding: 0 10px"> || ( '+' !== $spacing_scale['operator'] && '*' !== $spacing_scale['operator'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $spacing_scale ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __METHOD__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: theme.json, 2: settings.spacing.spacingScale */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Some of the %1$s %2$s values are invalid' ),
</span></span></pre></div>
<a id="trunksrcwpincludesfeedphp"></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/feed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/feed.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/feed.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -587,7 +587,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 ( ! function_exists( 'xml_parser_create' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( '', __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return array( 'html', "<![CDATA[$data]]>" );
</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 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/formatting.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5518,10 +5518,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_scalar( $text ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * To maintain consistency with pre-PHP 8 error levels,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * trigger_error() is used to trigger an E_USER_WARNING,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * wp_trigger_error() is used to trigger an E_USER_WARNING,
</ins><span class="cx" style="display: block; padding: 0 10px"> * rather than _doing_it_wrong(), which triggers an E_USER_NOTICE.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ '',
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: The function name, 2: The argument number, 3: The argument name, 4: The expected type, 5: The provided type. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Warning: %1$s expects parameter %2$s (%3$s) to be a %4$s, %5$s given.' ),
</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 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/functions.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4611,7 +4611,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $filename = wp_normalize_path( realpath( $filename ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $filename ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Path to the JSON file. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( "File %s doesn't exist!" ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4625,7 +4626,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $decoded_file = json_decode( file_get_contents( $filename ), $options['associative'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( JSON_ERROR_NONE !== json_last_error() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: Path to the JSON file, 2: Error message. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Error when decoding a JSON file at path %1$s: %2$s' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8757,7 +8759,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function clean_dirsize_cache( $path ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_string( $path ) || empty( $path ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ '',
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: Function name, 2: A variable type, like "boolean" or "integer". */
</span><span class="cx" style="display: block; padding: 0 10px"> __( '%1$s only accepts a non-empty path string, received %2$s.' ),
</span></span></pre></div>
<a id="trunksrcwpincludesmsdefaultconstantsphp"></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-default-constants.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/ms-default-constants.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/ms-default-constants.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,7 +147,8 @@
</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 ( $subdomain_error_warn ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: VHOST, 2: SUBDOMAIN_INSTALL */
</span><span class="cx" style="display: block; padding: 0 10px"> __( '<strong>Conflicting values for the constants %1$s and %2$s.</strong> The value of %2$s will be assumed to be your subdomain configuration setting.' ),
</span></span></pre></div>
<a id="trunksrcwpincludesrssphp"></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/rss.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rss.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/rss.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -63,7 +63,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> # Check if PHP xml isn't compiled
</span><span class="cx" style="display: block; padding: 0 10px"> #
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! function_exists('xml_parser_create') ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return trigger_error( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( '', "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." );
+ return;
</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"> $parser = xml_parser_create();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -387,7 +388,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function error( $errormsg, $lvl = E_USER_WARNING ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( MAGPIE_DEBUG ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( $errormsg, $lvl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error('', $errormsg, $lvl);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> error_log( $errormsg, 0);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -823,7 +824,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function error ($errormsg, $lvl=E_USER_WARNING) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->ERROR = $errormsg;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( MAGPIE_DEBUG ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( $errormsg, $lvl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( '', $errormsg, $lvl);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> else {
</span><span class="cx" style="display: block; padding: 0 10px"> error_log( $errormsg, 0);
</span></span></pre></div>
<a id="trunksrcwpincludesthemephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/theme.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/theme.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -514,7 +514,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Start with directories in the root of the active theme directory.
</span><span class="cx" style="display: block; padding: 0 10px"> $dirs = @ scandir( $theme_root );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $dirs ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( "$theme_root is not readable", E_USER_NOTICE );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( __FUNCTION__, "$theme_root is not readable" );
</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"> foreach ( $dirs as $dir ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -538,7 +538,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $sub_dirs = @ scandir( $theme_root . '/' . $dir );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $sub_dirs ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error( "$theme_root/$dir is not readable", E_USER_NOTICE );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error( __FUNCTION__, "$theme_root/$dir is not readable" );
</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"> foreach ( $sub_dirs as $sub_dir ) {
</span></span></pre></div>
<a id="trunksrcwpincludesupdatephp"></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/update.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/update.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/src/wp-includes/update.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,7 +202,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $response = wp_remote_post( $url, $options );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ssl && is_wp_error( $response ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Support forums URL. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,7 +441,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $raw_response = wp_remote_post( $url, $options );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ssl && is_wp_error( $raw_response ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Support forums URL. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -721,7 +723,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $raw_response = wp_remote_post( $url, $options );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ssl && is_wp_error( $raw_response ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trigger_error(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_trigger_error(
+ __FUNCTION__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Support forums URL. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
</span></span></pre></div>
<a id="trunktestsphpunittestsfilesystemwpOpcacheInvalidateDirectoryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/filesystem/wpOpcacheInvalidateDirectory.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/filesystem/wpOpcacheInvalidateDirectory.php 2024-06-13 15:04:50 UTC (rev 58408)
+++ trunk/tests/phpunit/tests/filesystem/wpOpcacheInvalidateDirectory.php 2024-06-13 20:48:33 UTC (rev 58409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_should_trigger_error_with_invalid_dir( $dir ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->expectError();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->expectErrorMessage(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<code>wp_opcache_invalidate_directory()</code>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '<code>wp_opcache_invalidate_directory()</code> expects a non-empty string.',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'The expected error was not triggered.'
</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>