SimpleHTMLTag.php line 44 Error Message

I have gotten this error message and I searched and can’t get an answer that I understand. I am running Backlight 1x, and I’m ready to upgrade to 3 but I want to fix this before I do. When clicking on a link to my galleries I get this error message. I found the line and I’ve pasted it below. What should I change to correct this?

count(): Parameter must be an array or an object that implements Countable in SimpleHTMLTag.php on line 44

This is the text of line 44 the first line being line 44:

		if (count($matches == 3)) {
			for ($i = 0; ; $i++) {
				if (!isset($matches[1][$i]) || !isset($matches[2][$i])) {
				if ($matches[1][$i] == '#') {
				} else if ($matches[1][$i] == '.') {

Any help would be appreciated……

I seem to remember that being fixed in a BL1 update? Are you using the most recent BL 1 version?

Or maybe it was a php compatibility issue; your host may have updated php, and BL 1 may no longer be compatible. Do you know what version your host is using?

Solution could be downgrading the php version. But upgrading to BL3 should fix the issue too since it’s compatible with current versions of php.

1 Like

The first line needs one of the closing parentheses moved, so that it looks like:

if (count($matches) == 3) {

I just took a look at the BL3 version of this file and it’s as Ben shows. So this issue won’t crop up in BL3 if you still plan on updating.

It’s also fixed in the last version of BL1, if you wanted to update to that (1.2.4)


You guys are the best. Thanks for all the help so fast…