• [Fri Mar 14 08:31:11.286302 2025] [proxy_fcgi:error] [pid 753818:tid 753842] [client 92.245.173.176:0] AH01071: Got error ‘PHP message: PHP Warning: Trying to access array offset on value of type bool in /home/XXXX/web/XXXXXXXXX/public_html/wp-content/plugins/cf7-antispam/core/CF7_AntiSpam_Flamingo.php on line 327’, referer: https://XXXXXXX/contact/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Francisco Panis Kaseker

    (@apterix)

    Consequence: The contact form sometimes work, sometimes not. PHP 8.1 is being used.

    I had the same warning on PHP 8.2. I guess line 326 is telling the truth (“this is a real monkey patching”) 🙂

    I added some additional checks to line 327, seems to work for me though I didn’t test extensively yet:
    $message_list = ( is_array( $additional_settings ) && isset( $additional_settings['message'] ) ) ? sanitize_text_field( implode( ' ', explode( '] [', $additional_settings['message'] ) ) ) : '';

    Plugin Author Erik

    (@codekraft)

    Hi everyone,

    Thanks for reporting this PHP warning issue, I apologize but I just saw this issue today 🥲. I’ve just identified the root cause and have implemented a fix. The warning “Trying to access array offset on value of type bool” was occurring because the cf7a_get_mail_additional_data() function was sometimes returning false instead of an array, but the code was trying to access $additional_settings['message'] without proper validation.

    I’ve updated the code to include proper type checking before accessing array elements. The problematic line:

    $message_list = sanitize_text_field( implode( ' ', explode( '] [', $additional_settings['message'] ) ) );

    Has been replaced with:

    $message_list = ( is_array( $additional_settings ) && isset( $additional_settings['message'] ) && is_string( $additional_settings['message'] ) ) ? sanitize_text_field( implode( ' ', explode( '] [', $additional_settings['message'] ) ) ) : '';

    Thanks for your patience and for helping identify this issue! the fix will be published tomorrow in the 0.6.4 version

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

You must be logged in to reply to this topic.