Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter rccservice

    (@rccservice)

    Right, sorry forgot to post the filename where the piece of code is from. It’s from the mail.php from cf7 (fullpath: ‘yourwp-home’\wp-content\plugins\contact-form-7\includes\mail.php). I know this originates in CF7, but if people have this problem they will look here for a solution.

    Thread Starter rccservice

    (@rccservice)

    Found the problem and a solution:
    These lines of code are the culprits:

    ????????????????if ( ! wpcf7_is_file_path_in_content_dir( $path ) ) {
    ????????????????????if ( WP_DEBUG ) {
    ????????????????????????trigger_error(
    ????????????????????????????sprintf(
    ????????????????????????????????/* translators: %s: Attachment file path.?
    ????????????????????????????????__( ‘Failed to attach a file. %s is not in the allowed directory.’, ‘contact-form-7’ ),
    ????????????????????????????????$path
    ????????????????????????????),
    ????????????????????????????E_USER_NOTICE
    ????????????????????????);
    ????????????????????}

    ????????????????????return false;
    ????????????????}

    As far as I can see these lines do nothing useful, because there is a check if the folder is writeable a few lines later.

    Thread Starter rccservice

    (@rccservice)

    After some digging I found that the PDF file gets generated, the mail gets sent but the PDF isn’t attached to it.

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