gtbu / Typesetter-5.3-p8

Typesetter 5.2+ with updates and adaptions for php8
http://typesetter5.bplaced.net
GNU General Public License v2.0
11 stars 7 forks source link

open_basedir restriction in effect #14

Open gtbu opened 1 year ago

gtbu commented 1 year ago

Some users will get the error : file_exists(): open_basedir restriction in effect. File(//customizer.php) is not within the allowed path(s)

This is in all CMSses because of file_exists() implementation ( also is_file() )

Solutions are entries in the php.ini and httpd.conf like open_basedir = none

To avoid this You can replace in include/tool / Output.php 266

if( !file_exists($customizer_file) ) {

with

$cust_path = stream_resolve_include_path($customizer_file); if (!$cust_path || !is_readable($cust_path)) {

// msg('customizer file ' . htmlspecialchars($customizer_file) . ' does not exist or is not readable'); // TODO remove
return [];

}

osopolar commented 1 year ago

@gtbu I finally had some time to check your suggested solution. It work around fine and so fixes the issue with open_basedir enabled, thank you. Workaround, because if the customizer.php is present in the webservers root directory it still tries to load that, which still does not seem right to me, or is that intentional?

Would you like a PR for above modifications?