Opened 14 years ago
Closed 14 years ago
#7997 closed defect (fixed)
open_basedir error due to module loading bug
Reported by: | Owned by: | Rob Smith | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | Plugin - MythWeb | Version: | unknown |
Severity: | medium | Keywords: | open_basedir open basedir modules |
Cc: | Ticket locked: | no |
Description
Hi,
I already saw the 2 similar bugs that won't get fixed, but I believe that the code is still faulty. Have a look at the thrown message: "Warning at /srv/http/mythweb/classes/Modules.php, line 30: file_exists(): open_basedir restriction in effect. File(./modules/welcome.php/init.php) is not within the allowed path(s): (/srv/http)
In fact, the file ./modules/welcome.php/init.php is nonexistent. Modules.php makes a list of files in the modules directory, assumes they are subdirectories and tries to load init.php in each of the directories. welcome.php isn't a directory, hence you shouldn't treat it as one.
Here's a cheap fix: In includes/utils.php is a function called get_sorted_files. Replace
$file == '..') continue; |
with
$file == '..' | $file == 'welcome.php') continue; |
Probably there's someone that can do a lot better than this, but this did it for me.
here was my fix, insert text with +++ below in Modules.php around line 26