Proposed Bug Fix: PHP compatibility issue causing fatal error in recent release
-
Simply put, the commas at the end of a list/array of items is generally not problematic (though a bit unnecessary), but PHP 7.2 for some odd reason made it so having that trailing comma at then end of the parameters when calling a function causes a 500 server error. This recent release of Cool Timeline today had one occurrence of that which is breaking things site-wide for any site that happens to be on PHP 7.2.x. (with this plugin currently stating PHP version compliance of 5.6 and above so some sites might be set to auto-update with it having no reason to suspect there’d be an issue when it causes a full-site server error.)
Thankfully it’s a quick & easy fix as the only thing that needs to be done is edit
includes/shortcode-blocks/ctl-block.php
so that:$shortcode = sprintf( $shortcode_string, $layout, $skin, $showpost, $dateformat, $icons, $animation, $order, $storycontent, );
becomes:
$shortcode = sprintf( $shortcode_string, $layout, $skin, $showpost, $dateformat, $icons, $animation, $order, $storycontent );
(notice how it’s just a matter of removing the unnecessary trailing comma in the list of parameters when
sprintf
is being called withinctl_block_callback
.)Hopefully, this can be fixed & released as an updated version sooner than later so fewer sites using this plugin on PHP 7.2 encounter the site-wide error that’d otherwise come up with the recent update. Also, this is one aspect to be mindful of for future updates unless the new release simply increases the required PHP version of the plugin to be PHP 7.3 and newer or something to not have to worry about it as I believe this problem really only affected PHP 7.2.x.
- The topic ‘Proposed Bug Fix: PHP compatibility issue causing fatal error in recent release’ is closed to new replies.