Support » Plugin: WP Cerber Security, Anti-spam & Malware Scan » Redirection control breaks site

  • Resolved Mateusz Paulski

    (@mateuszp1)


    Iam getting this error. Its caused by redirect from qTranslate-X plugin that is redirecting from domain.com/en to domain.com for default language.

    Trying to get property of non-object in …..\wp-content\plugins\wp-cerber\wp-cerber.php on line 1374

    WP_DEBUG is set to true

    CHANGING FUNCTION TO THIS FIXED IT:

    
    function cerber_no_redirect( $location, $status ) {
    	global $current_user, $wp_cerber;
    	if ((!$current_user || $current_user->ID == 0) && $wp_cerber->getSettings( 'noredirect' ) ) {
    		//$str = 'redirect_to=' . urlencode( admin_url() );
    		$str = urlencode( '/wp-admin/' );
    		if(strpos('redirect_to=', $location)){
    			list ($junk, $redirect_to) = explode('redirect_to=',$location);
    			if ( strpos( $redirect_to, $str ) ) {
    				cerber_404_page();
    			}
    		}
    	}
    
    	return $location;
    }
    
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Redirection control breaks site’ is closed to new replies.