WordPress.org

Ready to get started?Download WordPress

Forums

Fast Secure Contact Form
[resolved] Minor Coding Mod Request (5 posts)

  1. AITpro
    Member
    Posted 2 years ago #

    Hello,

    I have a minor coding Mod request. BPS Pro is using .htaccess ErrorDocument to send hackers to a 403 BlackHole template and this is generating repeated PHP Errors in the php error log due to a session_start issue. This is only a PHP Warning message so no big deal, but I would like to request a suppression for these 2 functions below. Thanks.

    [18-Dec-2011 21:13:49] PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/xxxxx/public_html/wp-content/plugins/bulletproof-security/403.php:6) in /home/xxxxx/public_html/wp-content/plugins/si-contact-form/si-contact-form.php on line 1674

    Unmodified Code:

    function si_contact_start_session() {
    // a PHP session cookie is set so that the captcha can be remembered and function
    // this has to be set before any header output
    //echo "starting session ctf";
    // start cookie session, but do not start session if captcha is disabled in options
    if( !isset( $_SESSION ) ) { // play nice with other plugins
    session_cache_limiter ('private, must-revalidate');
    session_start();
    //echo "session started ctf";
    }
    } // end function si_contact_start_session

    Requested Modification:

    function si_contact_start_session() {
    // a PHP session cookie is set so that the captcha can be remembered and function
    // this has to be set before any header output
    //echo "starting session ctf";
    // start cookie session, but do not start session if captcha is disabled in options
    if( !isset( $_SESSION ) ) { // play nice with other plugins
    @session_cache_limiter ('private, must-revalidate');
    @session_start();
    //echo "session started ctf";
    }
    } // end function si_contact_start_session

    http://wordpress.org/extend/plugins/si-contact-form/

  2. AITpro
    Member
    Posted 2 years ago #

    Please disregard this request as I have come up with a better solution on my end. Thank you.

  3. mauryg
    Member
    Posted 2 years ago #

    @AITpro
    I am getting similar PHP warning messages and the CAPTCHA image is broken. Can you tell me what the 'better solution' was?

    Maury

  4. Mike Challis
    Member
    Plugin Author

    Posted 2 years ago #

    Either sessions are broken on your server or another plugin is outputting html before the header and causing a conflict. Your web host can fix the broken sessions if you make a trouble ticket. Include the page URL and the error message.

  5. AITpro
    Member
    Posted 2 years ago #

    @ mauryg
    hmm i thought i already posted my solution here. In my case i am a plugin author and i have a specific plugin template that needed to wipe the sessions started by Fast Secure Contact Form and start a new session to avoid nuisance php Warning errors and also not interfere with FSCF. So this solution should only be used if you have a similar situation. This is not a general solution to fix general session problems on WordPress sites and is for very specific usage. At the very top of the 403 BlackHole template...

    <?php ob_start(); ?>
    <?php session_cache_limiter('nocache'); ?>
    <?php session_start(); ?>
    <?php error_reporting(0); ?>
    <?php session_destroy(); ?>

    And i think that majority of header and sessions problems are usually caused by having whitespace somewhere. Like whitespace at the top of your php files or somewhere else where there should not be whitespace.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic