Skip to content

Commit f61ee94

Browse files
author
pento
committed
Users: Add extra checking to wp_new_user_notification().
Prevent a notification from being sent when an unrecognised value is passed in the `$notify` parameter. Props cthreelabs, 360zen. Fixes #44293. Built from https://develop.svn.wordpress.org/trunk@44611 git-svn-id: http://core.svn.wordpress.org/trunk@44442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent d619b6b commit f61ee94

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

wp-includes/pluggable.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,11 @@ function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' )
18941894
_deprecated_argument( __FUNCTION__, '4.3.1' );
18951895
}
18961896

1897+
// Accepts only 'user', 'admin' , 'both' or default '' as $notify
1898+
if ( ! in_array( $notify, array( 'user', 'admin', 'both', '' ), true ) ) {
1899+
return;
1900+
}
1901+
18971902
global $wpdb, $wp_hasher;
18981903
$user = get_userdata( $user_id );
18991904

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @global string $wp_version
1515
*/
16-
$wp_version = '5.1-beta1-44610';
16+
$wp_version = '5.1-beta1-44611';
1717

1818
/**
1919
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)