<!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>[54952] trunk: Code Modernization: Rename parameters that use reserved keywords in `wp-includes/pluggable.php`.</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/54952">54952</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/54952","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>2022-12-09 00:22:14 +0000 (Fri, 09 Dec 2022)</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: Rename parameters that use reserved keywords in `wp-includes/pluggable.php`.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.
This commit:
* Renames the `$die` parameter to `$stop` in `check_ajax_referer()`.
* Renames the `$default` parameter to `$fallback_url` in `wp_validate_redirect()`.
* Renames the `$default` parameter to `$default_value` in `get_avatar()`.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/52946">[52946]</a>, <a href="https://core.trac.wordpress.org/changeset/52996">[52996]</a>, <a href="https://core.trac.wordpress.org/changeset/52997">[52997]</a>, <a href="https://core.trac.wordpress.org/changeset/52998">[52998]</a>, <a href="https://core.trac.wordpress.org/changeset/53003">[53003]</a>, <a href="https://core.trac.wordpress.org/changeset/53014">[53014]</a>, <a href="https://core.trac.wordpress.org/changeset/53029">[53029]</a>, <a href="https://core.trac.wordpress.org/changeset/53039">[53039]</a>, <a href="https://core.trac.wordpress.org/changeset/53116">[53116]</a>, <a href="https://core.trac.wordpress.org/changeset/53117">[53117]</a>, <a href="https://core.trac.wordpress.org/changeset/53137">[53137]</a>, <a href="https://core.trac.wordpress.org/changeset/53174">[53174]</a>, <a href="https://core.trac.wordpress.org/changeset/53184">[53184]</a>, <a href="https://core.trac.wordpress.org/changeset/53185">[531
85]</a>, <a href="https://core.trac.wordpress.org/changeset/53192">[53192]</a>, <a href="https://core.trac.wordpress.org/changeset/53193">[53193]</a>, <a href="https://core.trac.wordpress.org/changeset/53198">[53198]</a>, <a href="https://core.trac.wordpress.org/changeset/53203">[53203]</a>, <a href="https://core.trac.wordpress.org/changeset/53207">[53207]</a>, <a href="https://core.trac.wordpress.org/changeset/53215">[53215]</a>, <a href="https://core.trac.wordpress.org/changeset/53216">[53216]</a>, <a href="https://core.trac.wordpress.org/changeset/53220">[53220]</a>, <a href="https://core.trac.wordpress.org/changeset/53230">[53230]</a>, <a href="https://core.trac.wordpress.org/changeset/53232">[53232]</a>, <a href="https://core.trac.wordpress.org/changeset/53236">[53236]</a>, <a href="https://core.trac.wordpress.org/changeset/53239">[53239]</a>, <a href="https://core.trac.wordpress.org/changeset/53240">[53240]</a>, <a href="https://core.trac.wordpress.org/changeset/53242">[53242]
</a>, <a href="https://core.trac.wordpress.org/changeset/53243">[53243]</a>, <a href="https://core.trac.wordpress.org/changeset/53245">[53245]</a>, <a href="https://core.trac.wordpress.org/changeset/53246">[53246]</a>, <a href="https://core.trac.wordpress.org/changeset/53257">[53257]</a>, <a href="https://core.trac.wordpress.org/changeset/53269">[53269]</a>, <a href="https://core.trac.wordpress.org/changeset/53270">[53270]</a>, <a href="https://core.trac.wordpress.org/changeset/53271">[53271]</a>, <a href="https://core.trac.wordpress.org/changeset/53272">[53272]</a>, <a href="https://core.trac.wordpress.org/changeset/53273">[53273]</a>, <a href="https://core.trac.wordpress.org/changeset/53274">[53274]</a>, <a href="https://core.trac.wordpress.org/changeset/53275">[53275]</a>, <a href="https://core.trac.wordpress.org/changeset/53276">[53276]</a>, <a href="https://core.trac.wordpress.org/changeset/53277">[53277]</a>, <a href="https://core.trac.wordpress.org/changeset/53281">[53281]</a
>, <a href="https://core.trac.wordpress.org/changeset/53283">[53283]</a>, <a href="https://core.trac.wordpress.org/changeset/53284">[53284]</a>, <a href="https://core.trac.wordpress.org/changeset/53285">[53285]</a>, <a href="https://core.trac.wordpress.org/changeset/53287">[53287]</a>, <a href="https://core.trac.wordpress.org/changeset/53364">[53364]</a>, <a href="https://core.trac.wordpress.org/changeset/53365">[53365]</a>, <a href="https://core.trac.wordpress.org/changeset/54927">[54927]</a>, <a href="https://core.trac.wordpress.org/changeset/54929">[54929]</a>, <a href="https://core.trac.wordpress.org/changeset/54930">[54930]</a>, <a href="https://core.trac.wordpress.org/changeset/54931">[54931]</a>, <a href="https://core.trac.wordpress.org/changeset/54932">[54932]</a>, <a href="https://core.trac.wordpress.org/changeset/54933">[54933]</a>, <a href="https://core.trac.wordpress.org/changeset/54938">[54938]</a>, <a href="https://core.trac.wordpress.org/changeset/54943">[54943]</a>,
<a href="https://core.trac.wordpress.org/changeset/54944">[54944]</a>, <a href="https://core.trac.wordpress.org/changeset/54945">[54945]</a>, <a href="https://core.trac.wordpress.org/changeset/54946">[54946]</a>, <a href="https://core.trac.wordpress.org/changeset/54947">[54947]</a>, <a href="https://core.trac.wordpress.org/changeset/54948">[54948]</a>, <a href="https://core.trac.wordpress.org/changeset/54950">[54950]</a>, <a href="https://core.trac.wordpress.org/changeset/54951">[54951]</a>.
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See <a href="https://core.trac.wordpress.org/ticket/56788">#56788</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludespluggablephp">trunk/src/wp-includes/pluggable.php</a></li>
<li><a href="#trunktestsphpunittestspluggablesignaturesphp">trunk/tests/phpunit/tests/pluggable/signatures.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<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 2022-12-08 19:29:51 UTC (rev 54951)
+++ trunk/src/wp-includes/pluggable.php 2022-12-09 00:22:14 UTC (rev 54952)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1289,13 +1289,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param false|string $query_arg Optional. Key to check for the nonce in `$_REQUEST` (since 2.5). If false,
</span><span class="cx" style="display: block; padding: 0 10px"> * `$_REQUEST` values will be evaluated for '_ajax_nonce', and '_wpnonce'
</span><span class="cx" style="display: block; padding: 0 10px"> * (in that order). Default false.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param bool $die Optional. Whether to die early when the nonce cannot be verified.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $stop Optional. Whether to stop early when the nonce cannot be verified.
</ins><span class="cx" style="display: block; padding: 0 10px"> * Default true.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
</span><span class="cx" style="display: block; padding: 0 10px"> * 2 if the nonce is valid and generated between 12-24 hours ago.
</span><span class="cx" style="display: block; padding: 0 10px"> * False if the nonce is invalid.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function check_ajax_referer( $action = -1, $query_arg = false, $stop = true ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( -1 == $action ) {
</span><span class="cx" style="display: block; padding: 0 10px"> _doing_it_wrong( __FUNCTION__, __( 'You should specify an action to be verified by using the first parameter.' ), '4.7.0' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1323,7 +1323,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'check_ajax_referer', $action, $result );
</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 ( $die && false === $result ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $stop && false === $result ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( wp_doing_ajax() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_die( -1, 403 );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1519,8 +1519,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $fallback_url The fallback URL to use by default.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $status The HTTP response status code to use.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $fallback_url = apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $location = wp_validate_redirect( $location, $fallback_url );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return wp_redirect( $location, $status, $x_redirect_by );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> endif;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1533,15 +1535,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * path. A plugin can therefore set or remove allowed host(s) to or from the
</span><span class="cx" style="display: block; padding: 0 10px"> * list.
</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 the host is not allowed, then the redirect is to $default supplied.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * If the host is not allowed, then the redirect is to $fallback_url supplied.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.8.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">- * @param string $location The redirect to validate.
- * @param string $default The value to return if $location is not allowed.
- * @return string redirect-sanitized URL.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $location The redirect to validate.
+ * @param string $fallback_url The value to return if $location is not allowed.
+ * @return string Redirect-sanitized URL.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function wp_validate_redirect( $location, $default = '' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function wp_validate_redirect( $location, $fallback_url = '' ) {
</ins><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><span class="cx" style="display: block; padding: 0 10px"> if ( '//' === substr( $location, 0, 2 ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1557,12 +1559,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Give up if malformed URL.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false === $lp ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $default;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $fallback_url;
</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"> // Allow only 'http' and 'https' schemes. No 'data:', etc.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $lp['scheme'] ) && ! ( 'http' === $lp['scheme'] || 'https' === $lp['scheme'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $default;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $fallback_url;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $lp['host'] ) && ! empty( $lp['path'] ) && '/' !== $lp['path'][0] ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1577,13 +1579,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Reject if certain components are set but host is not.
</span><span class="cx" style="display: block; padding: 0 10px"> // This catches URLs like https:host.com for which parse_url() does not set the host field.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $default;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $fallback_url;
</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"> // Reject malformed components parse_url() can return on odd inputs.
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( 'user', 'pass', 'host' ) as $component ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $default;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $fallback_url;
</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">@@ -1600,7 +1602,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts, true ) && strtolower( $wpp['host'] ) !== $lp['host'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $location = $default;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $location = $fallback_url;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $location;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2746,16 +2748,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0 Optional `$args` parameter added.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
- * user email, WP_User object, WP_Post object, or WP_Comment object.
- * @param int $size Optional. Height and width of the avatar image file in pixels. Default 96.
- * @param string $default Optional. URL for the default image or a default type. Accepts '404'
- * (return a 404 instead of a default image), 'retro' (8bit), 'monsterid'
- * (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"),
- * 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF),
- * or 'gravatar_default' (the Gravatar logo). Default is the value of the
- * 'avatar_default' option, with a fallback of 'mystery'.
- * @param string $alt Optional. Alternative text to use in img tag. Default empty.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
+ * @param int $size Optional. Height and width of the avatar image file in pixels. Default 96.
+ * @param string $default_value Optional. URL for the default image or a default type. Accepts '404'
+ * (return a 404 instead of a default image), 'retro' (8bit), 'monsterid'
+ * (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"),
+ * 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF),
+ * or 'gravatar_default' (the Gravatar logo). Default is the value of the
+ * 'avatar_default' option, with a fallback of 'mystery'.
+ * @param string $alt Optional. Alternative text to use in img tag. Default empty.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $args {
</span><span class="cx" style="display: block; padding: 0 10px"> * Optional. Extra arguments to retrieve the avatar.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2776,7 +2778,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|false `<img>` tag for the user's avatar. False on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function get_avatar( $id_or_email, $size = 96, $default_value = '', $alt = '', $args = null ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $defaults = array(
</span><span class="cx" style="display: block; padding: 0 10px"> // get_avatar_data() args.
</span><span class="cx" style="display: block; padding: 0 10px"> 'size' => 96,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2803,7 +2805,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"> $args['size'] = (int) $size;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $args['default'] = $default;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $args['default'] = $default_value;
</ins><span class="cx" style="display: block; padding: 0 10px"> $args['alt'] = $alt;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = wp_parse_args( $args, $defaults );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2907,14 +2909,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.2.0 The `$args` parameter was added.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $avatar HTML for the user's avatar.
- * @param mixed $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,
- * user email, WP_User object, WP_Post object, or WP_Comment object.
- * @param int $size Square avatar width and height in pixels to retrieve.
- * @param string $default URL for the default image or a default type. Accepts '404', 'retro', 'monsterid',
- * 'wavatar', 'indenticon', 'mystery', 'mm', 'mysteryman', 'blank', or 'gravatar_default'.
- * @param string $alt Alternative text to use in the avatar image tag.
- * @param array $args Arguments passed to get_avatar_data(), after processing.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $avatar HTML for the user's avatar.
+ * @param mixed $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,
+ * user email, WP_User object, WP_Post object, or WP_Comment object.
+ * @param int $size Square avatar width and height in pixels to retrieve.
+ * @param string $default_value URL for the default image or a default type. Accepts '404', 'retro', 'monsterid',
+ * 'wavatar', 'indenticon', 'mystery', 'mm', 'mysteryman', 'blank', or 'gravatar_default'.
+ * @param string $alt Alternative text to use in the avatar image tag.
+ * @param array $args Arguments passed to get_avatar_data(), after processing.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestspluggablesignaturesphp"></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/pluggable/signatures.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/pluggable/signatures.php 2022-12-08 19:29:51 UTC (rev 54951)
+++ trunk/tests/phpunit/tests/pluggable/signatures.php 2022-12-09 00:22:14 UTC (rev 54952)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -173,7 +173,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'check_ajax_referer' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'action' => -1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'query_arg' => false,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'die' => true,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'stop' => true,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_redirect' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'location',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,7 +189,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_validate_redirect' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'location',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'default' => '',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'fallback_url' => '',
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_notify_postauthor' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_id',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,10 +231,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_set_password' => array( 'password', 'user_id' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'get_avatar' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'id_or_email',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'size' => 96,
- 'default' => '',
- 'alt' => '',
- 'args' => null,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'size' => 96,
+ 'default_value' => '',
+ 'alt' => '',
+ 'args' => null,
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_text_diff' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'left_string',
</span></span></pre>
</div>
</div>
</body>
</html>