Fatal error: Call to undefined function array_replace in wizard.php on line 1335

Home Forums BulletProof Security Pro Fatal error: Call to undefined function array_replace in wizard.php on line 1335

This topic contains 2 replies, has 1 voice, and was last updated by  AITpro Admin 4 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8426

    AITpro Admin
    Keymaster

    Email Question:

    I keep getting this fatal error when I run the Pre-Install check. I have removed WordFence, I have removed all previous BPS versions. I have reinstalled a couple of times.

    Setup Wizard Pre-Installation Checks:

    Pass! Server API: CGI / Compatible Server Configuration.
    Pass! PHP Configuration Memory Limit is set to: 64M. It is recommended that you increase your memory limit to at least 128M.
    Pass! WordPress Language version check:
    Pass! secure.htaccess Root Master file htaccess creation.
    Pass! Root Folder BulletProof Mode activation.
    Pass! Root .htaccess file backup Successful!
    Pass! wp-admin BulletProof Mode activation.
    Your current Root .htaccess file is not locked. In order to ensure that the Setup Wizard completes successfully your files will NOT be locked by BPS Pro F-Lock. Your F-Lock settings will be set to “Turn Off Checking & Alerts”.
    Pass! The cURL Extension is Loaded/Installed on your website/Server.

    Fatal error: Call to undefined function array_replace() in /home/content/xxxxx/html/wp-content/plugins/bulletproof-security/admin/wizard/wizard.php on line 1335
    #8428

    AITpro Admin
    Keymaster

    We have created a fallback function in the Setup Wizard for PHP Servers that do not have the array_replace function. This will be included as standard code in the Wizard for all future versions of BPS Pro.

    Credit for this code goes to:  MikevHoenselaar: https://github.com/MikeRogers0/PHP-HTML5-Form-class/issues/4

    Edit the wizard.php file: /home/content/58/10006658/html/wp-content/plugins/bulletproof-security/admin/wizard/wizard.php
    And add this new code directly above the bpsSetupWizardExcludeMediaBackup() function as shown below.

    Code line will be around 1272 in the wizard.php file.

    // Fallback function if the PHP Server does not have the array_replace function
    if ( !function_exists('array_replace') ) {
    
    function array_replace() {
    $array = array();
    $n = func_num_args();
    
    while ( $n-- >0 ) {
    $array+=func_get_arg($n);
    }
    return $array;
    }
    }
    
    // Pre-installation Setup Wizard - Create ARQ Exclude DB options/rules for folders that contain backups, other media types or files over 5MB
    function bpsSetupWizardExcludeMediaBackup() {
    #8431

    AITpro Admin
    Keymaster

    This new fallback/legacy code has been added to the BPS Pro zip file in the Secure Download Area.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.