Check if the given path is part of the subdirectories
under the base_dir.
public validRelativePath ( string $path ) : boolean | ||
$path | string | the relative path to be checked |
return | boolean | true if the path exists, false otherwise |
$relative = '/'; $manager = new ImageManager($IMConfig); //process any file uploads $manager->processUploads(); $manager->deleteFiles(); $refreshDir = false; //process any directory functions if ($manager->deleteDirs() || $manager->processNewDir()) { $refreshDir = true; } //check for any sub-directory request //check that the requested sub-directory exists //and valid if (isset($_REQUEST['dir'])) { $path = rawurldecode($_REQUEST['dir']); if ($manager->validRelativePath($path)) { $relative = $path; } } $manager = new ImageManager($IMConfig); //get the list of files and directories $list = $manager->getFiles($relative); /* ================= OUTPUT/DRAW FUNCTIONS ======================= */ /** * Draw the files in an table. */ function drawFiles($list, &$manager) { global $relative; global $IMConfig; switch ($IMConfig['ViewMode']) {