Path sent to content_lock_is_path_protected() is sometimes an array, which generates warnings

Created on 13 July 2017, about 8 years ago
Updated 11 June 2025, about 2 months ago

We discovered that the path sent to content_lock_is_path_protected() is periodically an array, which was generating scads of warnings for one of our clients (3 from content_lock_is_path_protected() and 1 from content_lock_content_lock_path_protected()).

Here are the warnings:

Warning: Illegal offset type in isset or empty in content_lock_is_path_protected() (line 144 of /home/vagrant/docroot/sites/all/modules/contrib/content_lock/content_lock.module).
Warning: Illegal offset type in content_lock_is_path_protected() (line 163 of /home/vagrant/docroot/sites/all/modules/contrib/content_lock/content_lock.module).
Warning: Illegal offset type in content_lock_is_path_protected() (line 165 of /home/vagrant/docroot/sites/all/modules/contrib/content_lock/content_lock.module).
Warning: strpos() expects parameter 1 to be string, array given in strpos() (line 173 of /home/vagrant/docroot/sites/all/modules/contrib/content_lock/content_lock.module).

I will upload a patch for this shortly.

πŸ› Bug report
Status

Closed: outdated

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States LNakamura

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    The latest supported versions of this module do not use this approach. It works on the entity type level not the paths.

Production build 0.71.5 2024