Ticket #22178: 22178.diff
File 22178.diff, 1.6 KB (added by , 12 years ago) |
---|
-
wp-includes/option.php
551 551 552 552 $last_time = (int) get_user_option( 'user-settings-time', $user->ID ); 553 553 $saved = isset( $_COOKIE['wp-settings-time-' . $user->ID]) ? preg_replace( '/[^0-9]/', '', $_COOKIE['wp-settings-time-' . $user->ID] ) : 0; 554 555 if ( $saved > $last_time ) { 554 if ( ( $saved > $last_time ) && ! ( is_super_admin( $user->ID ) && ! in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user->ID ) ) ) ) ) { 556 555 update_user_option( $user->ID, 'user-settings', $cookie, false ); 557 556 update_user_option( $user->ID, 'user-settings-time', time() - 5, false ); 558 557 return; … … 560 559 } 561 560 } 562 561 563 setcookie( 'wp-settings-' . $user->ID, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH ); 564 setcookie( 'wp-settings-time-' . $user->ID, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH ); 565 $_COOKIE['wp-settings-' . $user->ID] = $settings; 562 if ( $settings ) { 563 setcookie( 'wp-settings-' . $user->ID, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH ); 564 setcookie( 'wp-settings-time-' . $user->ID, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH ); 565 $_COOKIE['wp-settings-' . $user->ID] = $settings; 566 } 566 567 } 567 568 568 569 /** … … 697 698 if ( ! $user = wp_get_current_user() ) 698 699 return false; 699 700 701 if ( is_super_admin( $user->ID ) && 702 ! in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user->ID ) ) ) 703 ) 704 return; 705 700 706 $_updated_user_settings = $all; 701 707 $settings = ''; 702 708 foreach ( $all as $k => $v ) {