HI, besides Backlight I am still using TTG Gallery as plugin for my soccersite. Since my internetprovider upgraded PHP from 7.4 to 8.x I have an error which seems to boil down to one small bit of code. I’m not an programmer, so is there anyone in this community that could lend me a hand?
It’s this functiom and the more precisely the syntax ‘$matches [2]{0}’
function _doHeaders_callback_setext($matches) {
# Terrible hack to check we haven’t found an empty list item.
if ($matches[2] == ‘-’ && preg_match(’{^-(?: |$)}’, $matches[1]))
return $matches[0];
As the primary PHP developer of our products, that code snippet is not in a style that I have ever used. Are you running any other software on your server such as Wordpress?
Edit: it looks like that code is related to Markdown. It doesn’t seem to be in anything we’ve released from CE4 onwards.
The snippet is from a file called markdown.php which is part of either CE3 Gallery or CE3 Auto index. I no nothing about PHP, so perhaps you have a suggestion for a workaround?
Hi @Saam, using braces for array indexes is not supported in PHP 8.0.0 or newer. This error can probably be fixed by replacing the braces in array references that look like this {0} and {1} so that they become [0] and [1]. I doubt that we have used the older syntax in our own code (I personally have never used it), so this should be limited to third-party code such as Markdown.
It’s quite likely though that you’ll run into further compatibility issues. If you do then you may need to change back to PHP 7.4.