1234567891011121314151617181920212223 |
- <?php
- function data_mkdir($path,$newdir){
- $filteredpath = realpath($GLOBALS["conf"]["data_basedir"]."/".trim($path));
- if(strpos($filteredpath, $GLOBALS["conf"]["data_basedir"]) === FALSE){
- return FALSE; // noooo
- } else {
- $absnewdirpath = $filteredpath."/".trim($newdir);
- if (!file_exists($absnewdirpath)) {
- if (!mkdir($absnewdirpath, 0755, true)) {
- return FALSE;
- } else {
- return TRUE;
- }
- } else {
- return FALSE;
- }
- }
- }
- ?>
|