• Resolved AITpro

    (@aitpro)


    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

    https://www.ads-software.com/extend/plugins/si-contact-form/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter AITpro

    (@aitpro)

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

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

    Maury

    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.

    Thread Starter AITpro

    (@aitpro)

    @ 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Fast Secure Contact Form] Minor Coding Mod Request’ is closed to new replies.