pThumb icon indicating copy to clipboard operation
pThumb copied to clipboard

Fix PHP warning : is_readable() open_basedir restriction in effect.

Open Maef opened this issue 2 years ago • 0 comments

The Modx error log is flooded with lines like the example below when using open_basedir settings in php.ini. (open_basedir is used as a security measure)

PHP warning: is_readable(): open_basedir restriction in effect. File(/static/img/abc.webp) is not within the allowed path(s): (/var/sitename/htdocs:/tmp)

Testing if open_basedir has a string prevents is_readable() being called with a path outside these limits. Thus avoiding these loglines.

Maef avatar Nov 27 '22 14:11 Maef