Error when s3fs is used as a public replacement

Created on 2 May 2023, over 1 year ago
Updated 3 May 2023, over 1 year ago

Problem/Motivation

Latest 7.x-3.x release generates a strpos error in the new _pathologic_is_file_directory function. The value of of $dir is empty if public:// has been replaced with AWS S3 using the s3fs module:

Warning: strpos(): Empty needle in _pathologic_is_file_directory() (line 549 of /sites/all/modules/contrib/pathologic/pathologic.module).

Steps to reproduce

Install pathologic and the s3fs module. Configure s3fs to be used as a replacement for public:// rather than its own stream at s3://. Loading any page will cause the warning error to be displayed.

Proposed resolution

See the attached patch. File directory check can be bypassed if $dir is empty, and s3fs module exists and is used as a public:// replacement.

Remaining tasks

Please review the attached patch and provide any feedback, thank you.

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ron_s

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

Comments & Activities

Production build 0.71.5 2024