mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 11:35:48 +00:00
sanitize domains in ms-options, fixes #11775
git-svn-id: http://svn.automattic.com/wordpress/trunk@13447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
42703bfe08
commit
a399b4b845
@ -40,8 +40,11 @@ switch ( $_GET['action'] ) {
|
|||||||
if ( $_POST['limited_email_domains'] != '' ) {
|
if ( $_POST['limited_email_domains'] != '' ) {
|
||||||
$limited_email_domains = str_replace( ' ', "\n", $_POST[ 'limited_email_domains' ] );
|
$limited_email_domains = str_replace( ' ', "\n", $_POST[ 'limited_email_domains' ] );
|
||||||
$limited_email_domains = split( "\n", stripslashes( $limited_email_domains ) );
|
$limited_email_domains = split( "\n", stripslashes( $limited_email_domains ) );
|
||||||
|
$limited_email = array();
|
||||||
foreach ( (array) $limited_email_domains as $domain ) {
|
foreach ( (array) $limited_email_domains as $domain ) {
|
||||||
$limited_email[] = trim( $domain );
|
$domain = trim( $domain );
|
||||||
|
if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
|
||||||
|
$limited_email[] = trim( $domain );
|
||||||
}
|
}
|
||||||
update_site_option( "limited_email_domains", $limited_email );
|
update_site_option( "limited_email_domains", $limited_email );
|
||||||
} else {
|
} else {
|
||||||
@ -50,8 +53,11 @@ switch ( $_GET['action'] ) {
|
|||||||
|
|
||||||
if ( $_POST['banned_email_domains'] != '' ) {
|
if ( $_POST['banned_email_domains'] != '' ) {
|
||||||
$banned_email_domains = split( "\n", stripslashes( $_POST[ 'banned_email_domains' ] ) );
|
$banned_email_domains = split( "\n", stripslashes( $_POST[ 'banned_email_domains' ] ) );
|
||||||
|
$banned = array();
|
||||||
foreach ( (array) $banned_email_domains as $domain ) {
|
foreach ( (array) $banned_email_domains as $domain ) {
|
||||||
$banned[] = trim( $domain );
|
$domain = trim( $domain );
|
||||||
|
if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
|
||||||
|
$banned[] = trim( $domain );
|
||||||
}
|
}
|
||||||
update_site_option( "banned_email_domains", $banned );
|
update_site_option( "banned_email_domains", $banned );
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user