| | 1925 | function signup_nonce_fields() { |
|---|
| | 1926 | $id = mt_rand(); |
|---|
| | 1927 | echo "<input type='hidden' name='signup_form_id' value='{$id}' />"; |
|---|
| | 1928 | wp_nonce_field('signup_form_' . $id, '_signup_form', false); |
|---|
| | 1929 | } |
|---|
| | 1930 | add_action( 'signup_hidden_fields', 'signup_nonce_fields' ); |
|---|
| | 1931 | |
|---|
| | 1932 | function signup_nonce_check( $result ) { |
|---|
| | 1933 | if ( wp_create_nonce('signup_form_' . $_POST[ 'signup_form_id' ]) != $_POST['_signup_form'] ) |
|---|
| | 1934 | wp_die( 'Please try again!' ); |
|---|
| | 1935 | |
|---|
| | 1936 | return $result; |
|---|
| | 1937 | } |
|---|
| | 1938 | add_filter( 'wpmu_validate_blog_signup', 'signup_nonce_check' ); |
|---|
| | 1939 | add_filter( 'wpmu_validate_user_signup', 'signup_nonce_check' ); |
|---|