omeka-s-modules / Sharing

Omeka S module for sharing content via 1) Social Media and 2) Embedding Omeka S content in other sites
GNU General Public License v3.0
4 stars 6 forks source link

Deprecated `Passing null to strstr()` #43

Closed cy-altern closed 1 year ago

cy-altern commented 1 year ago

On a page with a oEmbed video got error :

Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in .../modules/Sharing/Module.php on line 264

Note that in the database's media table, the media_type field is empty (which is "normal" since the oEmbed call can provide many possible types...)

Versions : Module Sharing up to date (rev. 90057c12605405efba516337ff6ef4d3d5231335) + Omeka S 4.0.1 (rev. 47888f351dd574dfcb885e317a546ad738c13295)

zerocrates commented 1 year ago

Yeah, this is a PHP 8.1 deprecation that only happens here when dealing with media that don't have a media type. As you say that's normal for oEmbed, and really any media that doesn't correspond to a stored file.

If you pull in the latest commit it should resolve this notice for you.

cy-altern commented 1 year ago

thanks for your quick response !