diff --git a/.gitchange b/.gitchange index 412f78b5..45345fea 100644 --- a/.gitchange +++ b/.gitchange @@ -1 +1 @@ -1450447258 +1450450975 diff --git a/s2member/includes/classes/mms-patches.inc.php b/s2member/includes/classes/mms-patches.inc.php index c39a8118..366e8a2a 100644 --- a/s2member/includes/classes/mms-patches.inc.php +++ b/s2member/includes/classes/mms-patches.inc.php @@ -88,9 +88,9 @@ public static function mms_patches ($display_notices = FALSE) else // Otherwise, we need to report that /wp-login.php could NOT be updated. Possibly a permissions error. ($display_notices) ? c_ws_plugin__s2member_admin_notices::display_admin_notice ('Your /wp-login.php file could NOT be patched. File NOT writable.', true) : null; - $load_file = ABSPATH . WPINC . "/load.php"; - $load_section = "/([\r\n\t\s ]+)(if( *?)\(( *?)empty( *?)\(( *?)\\\$active_plugins( *?)\)( *?)\|\|( *?)defined( *?)\(( *?)['\"]WP_INSTALLING['\"]( *?)\)( *?)\))/"; - $load_replace = "\n\n\t// Modified for full plugin compatiblity.\n\t//if ( empty( \$active_plugins ) || defined( 'WP_INSTALLING' ) )\n\tif ( empty( \$active_plugins ) || ( defined( 'WP_INSTALLING' ) && !preg_match(\"/\/wp-activate\.php/\", \$_SERVER[\"REQUEST_URI\"]) ) )"; + $load_file = ABSPATH . WPINC . "/load.php"; // WordPress v4.4 uses `wp_installing()` instead of `defined( 'WP_INSTALLING' )` + $load_section = "/([\r\n\t\s ]+)(if( *?)\(( *?)empty( *?)\(( *?)\\\$active_plugins( *?)\)( *?)\|\|( *?)(wp_installing\s*\(\s*\)|defined( *?)\(( *?)['\"]WP_INSTALLING['\"]( *?)\))( *?)\))/"; + $load_replace = "\n\n\t// Modified for full plugin compatiblity.\n\t//if ( empty( \$active_plugins ) || wp_installing() )\n\tif ( empty( \$active_plugins ) || ( wp_installing() && !preg_match(\"/\/wp-activate\.php/\", \$_SERVER[\"REQUEST_URI\"]) ) )"; if (file_exists ($load_file) && ($load = file_get_contents ($load_file)) && is_writable ($load_file)) { diff --git a/s2member/includes/menu-pages/code-samples/mms-patch-load.x-php b/s2member/includes/menu-pages/code-samples/mms-patch-load.x-php index 4e7ddd7d..57f6abb3 100644 --- a/s2member/includes/menu-pages/code-samples/mms-patch-load.x-php +++ b/s2member/includes/menu-pages/code-samples/mms-patch-load.x-php @@ -1,4 +1,4 @@ // Modified for full plugin compatiblity. - //if ( empty( $active_plugins ) || defined( 'WP_INSTALLING' ) ) - if ( empty( $active_plugins ) || ( defined( 'WP_INSTALLING' ) && !preg_match("/\/wp-activate\.php/", $_SERVER["REQUEST_URI"]) ) ) - return $plugins; \ No newline at end of file + //if ( empty( $active_plugins ) || wp_installing() ) + if ( empty( $active_plugins ) || ( wp_installing() && !preg_match("/\/wp-activate\.php/", $_SERVER["REQUEST_URI"]) ) ) + return $plugins;