Ticket #9751: php4.nag.patch
| File php4.nag.patch, 3.8 KB (added by , 17 years ago) |
|---|
-
htdocs/wordpresstrunk/wp-admin/includes/upgrade.php
75 76 $wp_rewrite->flush_rules(); 76 77 77 78 wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password); 78 79 wp_check_php_version(); 79 80 wp_cache_flush(); 80 81 81 82 return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password, 'password_message' => $message); … … 268 269 return; 269 270 270 271 wp_check_mysql_version(); 272 wp_check_php_version(); 271 273 wp_cache_flush(); 272 274 make_db_current_silent(); 273 275 upgrade_all(); … … 1656 1658 } 1657 1659 } 1658 1660 1661 /** 1662 * Checks if the current version of PHP is below the nag level and adds usermeta to use to display a notice if it is 1663 * 1664 * @since ??? 1665 * @see php_below_min_nag() for the nag message displayed and php_below_min_nag_handler() for the function that stops display of the nag message 1666 * 1667 */ 1668 function wp_check_php_version(){ 1669 global $wp_php_min_version; 1670 global $wpdb; 1671 if (version_compare(PHP_VERSION, $wp_php_min_version, '<')) { 1672 $users = $wpdb->get_results("SELECT ID from $wpdb->users"); 1673 foreach ( (array) $users as $a_user ) { 1674 $user = new WP_User($a_user->ID); 1675 if ( $user->has_cap('install_plugins') ) 1676 update_usermeta($a_user->ID,'php_below_min_nag','true'); 1677 } 1678 } 1679 } 1659 1680 ?> -
htdocs/wordpresstrunk/wp-includes/version.php
30 30 * @global string $manifest_version 31 31 */ 32 32 $manifest_version = '20090616'; 33 34 /** 35 * Holds PHP min version to not nagged 36 * 37 * @global string $manifest_version 38 */ 39 $wp_php_min_version = '5.0.0'; 40 -
htdocs/wordpresstrunk/wp-admin/includes/user.php
838 838 } 839 839 840 840 /** 841 * If the phpversion is below the min, display a nag until it goes away 842 * 843 * @since 2.9.0 844 * @see wp_check_php_version() for the function that adds the nag on install and php_below_min_nag_handler() for the function that stops display of the nag message 845 * 846 */ 847 848 add_action('admin_notices', 'php_below_min_nag'); 849 function php_below_min_nag() { 850 global $user_ID; 851 if ( ! get_usermeta($user_ID, 'php_below_min_nag') ) 852 return; 853 854 echo '<div class="error php_below_min_nag"><p>'; 855 printf(__("Notice: Your Webserver is currently using PHP version 4, which is no longer recieving security updates and will no longer be supported by WordPress in an upcoming version<br /> 856 <a href='%1$s'>Learn more about this issue</a> | <a href='%2$s' id='php_below_min_nag-no'>I understand the issue and want you to stop informing me</a>"), 'http://codex.wordpress.org/Switching_to_PHP5', '?php_below_min_nag=0'); 857 echo '</p></div>'; 858 } 859 860 /** 861 * Checks if the current version of PHP is below the nag level and adds usermeta to use to display a notice if it is 862 * 863 * @since 2.9.0 864 * @see php_below_min_nag() for the nag message displayed and wp_check_php_version() for the function that adds the nag on install/upgrade 865 * 866 */ 867 add_action('admin_init', 'php_below_min_nag_handler'); 868 function php_below_min_nag_handler() { 869 global $user_ID; 870 if ( ! get_usermeta($user_ID, 'php_below_min_nag') ) //Short circuit it. 871 return; 872 873 if (isset($_GET['php_below_min_nag']) && '0' == $_GET['php_below_min_nag']) 874 delete_usermeta($user_ID, 'php_below_min_nag', 'true'); 875 876 } 877 878 /** 841 879 * Setup the default contact methods 842 880 * 843 881 * @access private