• Resolved a_hongjie

    (@a_hongjie)


    wp-content/plugins/events-manager/events-manager.php
    if( EM_MS_GLOBAL ){
    add_filter(‘pre_option_dbem_categories_enabled’, array(&$this,
    ‘pre_option_dbem_categories_enabled’), 1,1);
    }

    Above code will cause endless loop, because in the function of get_options, the hook filter will be applied again to call itself, how to avoid this problem?

    Here are related line in get_option function.
    $pre = apply_filters( “pre_option_{$option}”, false, $option, $default );

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    Sorry for the very late response. I have forwarded this to our Developers and I’ll let you know when I receive a response.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    Hello,

    Sorry for the delayed reply. Are you able to actually reproduce an endless loop? I never experienced this, nor do I see why it’d create an endless loop unless something in your site is messing with the is_main_site() or get_blog_option() core functions in WordPress.

    The function itself should only be called once, because it gets the option from the main blog, the second time it calls itself, it’ll skip the get_blog_option() call if statement:

    function pre_option_dbem_categories_enabled($value){
        if( !is_main_site() ){ //only alter value if not on main site already
            $value = get_blog_option(get_current_site()->blog_id, 'dbem_categories_enabled') ? 1:0; //return a number since false will not circumvent pre_option_ filter
        }
        return $value;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[NSFW] out of memory becasue of endless loop’ is closed to new replies.