Skip to content

Commit

Permalink
load.php patch update for WP v4.4. See: #812
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswsinc committed Dec 18, 2015
1 parent 246d0cb commit 969982e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions s2member/includes/classes/mms-patches.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>/wp-login.php</code> 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))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
//if ( empty( $active_plugins ) || wp_installing() )
if ( empty( $active_plugins ) || ( wp_installing() && !preg_match("/\/wp-activate\.php/", $_SERVER["REQUEST_URI"]) ) )
return $plugins;

0 comments on commit 969982e

Please sign in to comment.