1316 | | global $wp_default_secret_key; |
| 1316 | $secret_keys = array(); |
| 1317 | |
| 1318 | if ( defined( 'AUTH_KEY' ) ) |
| 1319 | $secret_keys[] = AUTH_KEY; |
| 1320 | if ( defined( 'SECURE_AUTH_KEY' ) ) |
| 1321 | $secret_keys[] = SECURE_AUTH_KEY; |
| 1322 | if ( defined( 'LOGGED_IN_KEY' ) ) |
| 1323 | $secret_keys[] = LOGGED_IN_KEY; |
| 1324 | if ( defined( 'NONCE_KEY' ) ) |
| 1325 | $secret_keys[] = NONCE_KEY; |
| 1326 | if ( defined( 'AUTH_SALT' ) ) |
| 1327 | $secret_keys[] = AUTH_SALT; |
| 1328 | if ( defined( 'SECURE_AUTH_SALT' ) ) |
| 1329 | $secret_keys[] = SECURE_AUTH_SALT; |
| 1330 | if ( defined( 'LOGGED_IN_SALT' ) ) |
| 1331 | $secret_keys[] = LOGGED_IN_SALT; |
| 1332 | if ( defined( 'NONCE_SALT' ) ) |
| 1333 | $secret_keys[] = NONCE_SALT; |
| 1334 | |
| 1335 | $wp_default_secret_key = ''; |
| 1336 | if ( !empty( $secret_keys ) ) { |
| 1337 | $secret_keys_count = array_count_values( $secret_keys ); |
| 1338 | arsort( $secret_keys_count ); |
| 1339 | if ( array_shift( array_values( $secret_keys_count ) ) > 1 ) |
| 1340 | $wp_default_secret_key = array_shift( array_keys( $secret_keys_count ) ); |
| 1341 | } |
| 1342 | |