Bug #23321 Bug Fixed

Contact Form tag on site index submits to invalid URL

Version: 4.0.1 Reporter: Jeremy Gimbel - Conflux Group

I imagine this is not a new bug, but thought I’d submit it anyway.

When using the {exp✉️contact_form} tag on the index of a site, the module forces the form to post to /index instead of the root of the site.

Line 998 of mod.email.php defaults the URI string to index if it is blank. It seems like this may be leftover from earlier versions.

  • In system/ee/EllisLab/Addons/email/mod.email.php remove line 1004, and on line 771 replace:

    if ($x[0] == '' OR ! preg_match('{^http(s)?:\/\/}i', $x[0]))
    {
        $return_link = ee()->functions->form_backtrack(1);
    }

    with:

    if ($x[0] == '')
    {
        $return_link = ee()->functions->form_backtrack(1);
    }
    elseif ( ! preg_match('{^http(s)?:\/\/}i', $x[0]))
    {
        $return_link = ee()->functions->create_url($x[0]);
    }
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases