Support » Plugin: AntiSpam for Contact Form 7 » Fatal error when opening a page with a contact forn

  • Resolved Silas_229

    (@silas2209)


    Fatal error: Uncaught Error: in_array(): Argument #2 ($haystack) must be of type array, string given
    in /var/www/vhosts/…/wp-content/plugins/cf7-antispam/core/CF7_AntiSpam_Frontend.php on line 158
    
    Call stack:
    
    in_array()
    wp-content/plugins/cf7-antispam/core/CF7_AntiSpam_Frontend.php:158
    CF7_AntiSpam\Core\CF7_AntiSpam_Frontend::cf7a_honeyform()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/plugin.php:205
    apply_filters()
    wp-includes/post-template.php:256
    the_content()
    wp-content/themes/hello-elementor/template-parts/single.php:25
    require()
    wp-includes/template.php:792
    load_template()
    wp-includes/template.php:725
    locate_template()
    wp-includes/general-template.php:206
    get_template_part()
    wp-content/themes/hello-elementor/index.php:21
    include()
    wp-includes/template-loader.php:106
    require_once()
    wp-blog-header.php:19
    require()
    index.php:17

    Do you need more information about that?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Erik

    (@codekraft)

    No, it’s fine and thanks for the detailed log! 😉
    Indeed it is not checked the options are of the type array, but it is very strange that you have the options stored as string… can you check the options page, save the options again or, eventually, reset them (at the end of the configuration panel under the advanced tab).

    Tomorrow I’ll have a better look at it, but if you can, try installing and uninstalling, it might solve the problem.
    Ah and thanks for the heads up! 🚀

    Thread Starter Silas_229

    (@silas2209)

    Saving the options page again and resetting it has not worked. The problem was that the experimental Honeypot form was enabled without any excluded pages. Therefore, an empty string was saved in the options array for the key honeyform_excluded_pages. After I added a page, an array was saved and the error was gone. You probably should initialize this option with an empty array instead of an empty string.

    • This reply was modified 1 month ago by Silas_229.
    Plugin Author Erik

    (@codekraft)

    OK I’m preparing a fix for this and other little issues and I’ll make a release that fixes them asap

    Thread Starter Silas_229

    (@silas2209)

    Great!

    Thread Starter Silas_229

    (@silas2209)

    Hi @codekraft,

    Generally I don’t attach much importance to being named in credits (in this case I didn’t even provide the fix), but I read a completely unrelated user in the changelog for “Fix/honeyform init” when updating. Could you adjust that?

    Thank you very much!

    Plugin Author Erik

    (@codekraft)

    👍sure and sorry for that. My commitment is to try to give credit to everyone who helped me even with a single report and that user really had. i just mixed your contribution with that one because i hadn’t noted it on GitHub correctly, sorry, I will fix it right away!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.