TypeError: Cannot access offset of type string on string

Created on 13 February 2023, over 1 year ago

Hello everyone, I understand that this module is not really actively maintained but was hoping someone could help me. I have come across this error when switching to php 8.1. The filter works on shorter URLs (www.nypost.com) but fails and gives and error on longer URLs (www.nypost.com/2023/02/12/mount-sinai-merger-bid-to-free-up-prized-east-...)

The page returns an error:

TypeError: Cannot access offset of type string on string in opengraph_filter_find_tags() (line 77 of modules/contrib/opengraph_filter/opengraph_filter.module)

In code the snip from line 77 looks like this:

  if (gettype(@$these_tags[$key]) != 'NULL') {
              if (gettype(@$these_tags) == 'string') {
                $these_tags = [$keys[$j - 1] => $these_tags];
                $these_tags[$key] = $found[6][$i];
              }
	

I have applied the patches to the dev version. Any help or point in the right direction would be much appreciated.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡΄Angola chipchenko

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024