errorlog_functions.php

4 posts by 2 authors in: Forums > CMS Builder
Last Post: January 6, 2020   (RSS)

By daniel - January 2, 2020

Hi Karls,

To help troubleshoot this issue, could you let me know what version of CMSB you are using, as well as the PHP version running on the server?

Thanks!

Daniel
Technical Lead
interactivetools.com

By ht1080z - January 2, 2020

Hi Daniel,

PHP v7.3.13
cmsB v3.12 (Build 2163)

Thank you!

By daniel - January 6, 2020

Hi ht1080z,

This is an issue that has been fixed in newer versions of CMSB, so one solution is to upgrade to the latest version. It is also relatively simple to patch the bug as a short term fix.

To do so, replace the following line in /cmsb/lib/errorlog_functions.php (line 494):

ob_start(); echo '1'; $ob_get_clean_response = ob_get_clean();

With this:

    // test if ob_start/ob_get_clean() is working.
    $ob_get_clean_response  = '1';
    $inOutputBufferCallback = 0;  // PHP throws an error if you call output buffering inside an output buffer callback
    foreach (ob_get_status(true) as $bufferStatus) { if ($bufferStatus['type'] == 1) { $inOutputBufferCallback = true; break; }}
    if (!$inOutputBufferCallback) { ob_start(); echo '1'; $ob_get_clean_response = ob_get_clean(); }

One of the cases where this issue can pop up is when trying to log an error, so it's possible that adding this fix could expose a different error message. Let me know if you need any further help!

Thanks,

Daniel
Technical Lead
interactivetools.com