• Resolved therealgilles

    (@chamois_blanc)


    When trying to use PHP 8, I ran into this PHP fatal error in the Customizer:

    [08-Mar-2022 16:35:52 UTC] PHP Fatal error:  Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in /var/www/wp-content/themes/hestia-pro/inc/help
    Stack trace:                                                                                                                                                                            
    #0 /var/www/wp-content/themes/hestia-pro/inc/helpers/layout-functions.php(1893): strpos(Array, 'fa-')                                                                                 
    #1 /var/www/wp-content/themes/hestia-pro/inc/addons/views/front-page/class-hestia-pricing-section.php(107): maybe_trigger_fa_loading(Array)                                           
    #2 /var/www/wp-includes/class-wp-hook.php(307): Hestia_Pricing_Section->render_section(false)                                                                                         
    #3 /var/www/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)                                                                                                       
    #4 /var/www/wp-includes/plugin.php(474): WP_Hook->do_action(Array)                                                                                                                    
    #5 /var/www/wp-content/themes/hestia-pro/inc/addons/views/front-page/class-hestia-pricing-section.php(32): do_action('hestia_do_prici...', false)                                       
    #6 /var/www/wp-includes/class-wp-hook.php(307): Hestia_Pricing_Section->do_section(false)                                                                                             
    #7 /var/www/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)                                                                                                     
    #8 /var/www/wp-includes/plugin.php(474): WP_Hook->do_action(Array)                                                                                                                    
    #9 /var/www/wp-content/themes/hestia-pro/front-page.php(39): do_action('hestia_sections', false)                                                                                        
    #10 /var/www/wp-includes/template-loader.php(106): include('/var/www/wp-con...')                                                                                                      
    #11 /var/www/wp-blog-header.php(19): require_once('/var/www/wp-inc...')                                                                                                                 
    #12 /var/www/index.php(17): require('/var/www/wp-blo...')                                                                                                                             
    #13 {main}                                                                                                                                                                              
      thrown in /var/www/wp-content/themes/hestia-pro/inc/helpers/layout-functions.php on line 1893

    Please fix.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    This is due to $html_allowed_strings:

    $html_allowed_strings = array(                                                       
                            $hestia_pricing_title,                                                             
                            $hestia_pricing_subtitle,                                           
                            $hestia_pricing_table_one_price,
                            $hestia_pricing_table_one_features,
                            $hestia_pricing_table_two_price,
                            $hestia_pricing_table_two_features,   
                    );

    being equal to:

    $html_allowed_strings = Array                                                                                                                               
    (                                                                                                                                                                                     
        [0] => Something                                                                                                                                                 
        [1] => Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.                                                
        [2] => <small>$</small>0                                                                                                                                                            
        [3] => Array                                                                                                                                                                      
            (                                                                                                                                                                               
                [0] => <b>1</b> Domain                                                                                                                                                    
                [1] => <b>1GB</b> Storage                                                                                                                                                   
                [2] => <b>100GB</b> Bandwidth                                                                                                                                     
                [3] => <b>2</b> Databases                                                                                                                                                   
            )                                                                                                                                                                     
                                                                                                                                                                                            
        [4] => <small>$</small>49                                                                                                                                                 
        [5] => Array                                                                                                                                                                      
            (                                                                                                                                                                             
                [0] => <b>5</b> Domain                                                                                                                                                    
                [1] => <b>Unlimited</b> Storage                                                                                                                                           
                [2] => <b>Unlimited</b> Bandwidth                                                                                                                                         
                [3] => <b>Unlimited</b> Databases                                                                                                                                         
            )                                                                                                                                                                             
                                                                                                                                                                                          
    )

    i.e. it contains arrays.

    Hello @chamois_blanc!

    I checked on a test instance with the latest versions of Hestia, WordPress and with PHP 8 and I don’t get any errors. I can access the Customizer as expected – screenshot. Please provide us additional information on how to reproduce the issue.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP 8 compatibility issue, fatal error in Customizer’ is closed to new replies.