WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Non-existing text-block causes "Fatal error: Maximum function nesting level"

[Resolved] Non-existing text-block causes "Fatal error: Maximum function nesting level"

  • plescheff
    Member

    @plescheff

    Hi,

    Found a bug in your plugin. If one uses text-block with non-existing id/slug then the plugin fails on that with following error message:
    Fatal error: Maximum function nesting level of ‘100’ reached, aborting!

    Affected plugin version: 1.4.2
    WP version: 3.6.1

    Steps to reproduce:
    a) have WordPress installed with plenty of pages (over 200 in my case);
    b) install and enable plugin;
    c) add random ID for text-block on page, e.g. [text-blocks id=nonexistingslug]
    d) save page and see resulting page (or error log)

    I traced the problem down to function “show_text_block” in text-blocks.php (starting from line 235).
    It expects $id to be numeric (line 238), if not then tries to get ID from path/slug with “get_page_by_path” (line 240). That function doesn’t guarantee to produce meaningful result.

    I fixed this with this patch after is_numeric check: added new lines from 244 to 247:

    if (!$id)
    {
    	return '';
    }

    Please add this fix (or other resolution) in next release.

    http://wordpress.org/plugins/reusable-text-blocks/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Non-existing text-block causes "Fatal error: Maximum function nesting level"’ is closed to new replies.