Changeset 28741 for trunk/src/wp-includes/pluggable.php
- Timestamp:
- 06/11/2014 06:35:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r28628 r28741 1774 1774 foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) { 1775 1775 foreach ( array( 'KEY', 'SALT' ) as $second ) { 1776 if ( ! defined( "{$first}_{$second}" ) ) 1776 if ( ! defined( "{$first}_{$second}" ) ) { 1777 1777 continue; 1778 } 1778 1779 $value = constant( "{$first}_{$second}" ); 1779 1780 $duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] ); … … 1782 1783 } 1783 1784 1784 $key = $salt = ''; 1785 if ( defined( 'SECRET_KEY' ) && SECRET_KEY && empty( $duplicated_keys[ SECRET_KEY ] ) ) 1786 $key = SECRET_KEY; 1787 if ( 'auth' == $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) 1788 $salt = SECRET_SALT; 1785 $values = array( 1786 'key' => '', 1787 'salt' => '' 1788 ); 1789 if ( defined( 'SECRET_KEY' ) && SECRET_KEY && empty( $duplicated_keys[ SECRET_KEY ] ) ) { 1790 $values['key'] = SECRET_KEY; 1791 } 1792 if ( 'auth' == $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) { 1793 $values['salt'] = SECRET_SALT; 1794 } 1789 1795 1790 1796 if ( in_array( $scheme, array( 'auth', 'secure_auth', 'logged_in', 'nonce' ) ) ) { … … 1792 1798 $const = strtoupper( "{$scheme}_{$type}" ); 1793 1799 if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) { 1794 $ $type= constant( $const );1795 } elseif ( ! $ $type) {1796 $ $type= get_site_option( "{$scheme}_{$type}" );1797 if ( ! $ $type) {1798 $ $type= wp_generate_password( 64, true, true );1799 update_site_option( "{$scheme}_{$type}", $ $type);1800 $values[ $type ] = constant( $const ); 1801 } elseif ( ! $values[ $type ] ) { 1802 $values[ $type ] = get_site_option( "{$scheme}_{$type}" ); 1803 if ( ! $values[ $type ] ) { 1804 $values[ $type ] = wp_generate_password( 64, true, true ); 1805 update_site_option( "{$scheme}_{$type}", $values[ $type ] ); 1800 1806 } 1801 1807 } 1802 1808 } 1803 1809 } else { 1804 if ( ! $ key) {1805 $ key= get_site_option( 'secret_key' );1806 if ( ! $ key) {1807 $ key= wp_generate_password( 64, true, true );1808 update_site_option( 'secret_key', $ key);1810 if ( ! $values['key'] ) { 1811 $values['key'] = get_site_option( 'secret_key' ); 1812 if ( ! $values['key'] ) { 1813 $values['key'] = wp_generate_password( 64, true, true ); 1814 update_site_option( 'secret_key', $values['key'] ); 1809 1815 } 1810 1816 } 1811 $ salt = hash_hmac( 'md5', $scheme, $key);1812 } 1813 1814 $cached_salts[ $scheme ] = $ key . $salt;1817 $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] ); 1818 } 1819 1820 $cached_salts[ $scheme ] = $values['key'] . $values['salt']; 1815 1821 1816 1822 /** This filter is documented in wp-includes/pluggable.php */
Note: See TracChangeset
for help on using the changeset viewer.