WordPress.org

Ready to get started?Download WordPress

Forums

Reusable Text Blocks
[resolved] Non-existing text-block causes "Fatal error: Maximum function nesting level" (5 posts)

  1. plescheff
    Member
    Posted 6 months ago #

    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/

  2. Hal Gatewood
    Member
    Plugin Author

    Posted 6 months ago #

    awesome thanks! I'll get it added.

  3. plescheff
    Member
    Posted 3 months ago #

    This fix (or any other solution) wasn't added to latest release. After updating to plugin v 1.4.3 (WP3.8) again getting "Fatal error: Maximum function nesting level of '100' reached, aborting!".

    Also there seems to be typo in changelog page (http://wordpress.org/plugins/reusable-text-blocks/changelog/) where it says changes for 1.4.4 instead of 1.4.3?

  4. Hal Gatewood
    Member
    Plugin Author

    Posted 3 months ago #

    Sure enough, sorry about that. Pushing an update now.

  5. plescheff
    Member
    Posted 3 months ago #

    Awesome! Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.