Failure to check for existing dir

Bug #529565 reported by QC
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pluck CMS
Fix Released
Undecided
Unassigned

Bug Description

in install.php you have:

//Make some dirs for the trashcan and modulesettings
mkdir('data/trash/pages', 0777);
chmod('data/trash/pages', 0777);
.....

So you are "assuming" the dir do not exist! Yet going "back" to the page in the browser issues warnings that the dir already does exist and the above code is trying to recreate them! Wrong and sloppy.

Warnings are there to tell you something about your code, often something that needs to be fixed. You seem to have warnings turned off so are missing these clues to better coding. You should have written it as:

if (!file_exists('data/trash/pages')) {
   mkdir('data/trash/pages', 0777);
   chmod('data/trash/pages', 0777);
}
... etc for each dir.

Related branches

Changed in pluck-cms:
status: New → Fix Committed
Sander (sanderth)
Changed in pluck-cms:
milestone: none → 4.7-beta
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.