$user_dir = userDir('/var/pma_tmp/%u/'); // '/var/pma_tmp/root/'
public static function userDir($dir) { // add trailing slash if (mb_substr($dir, -1) != '/') { $dir .= '/'; } return str_replace('%u', PMA_securePath($GLOBALS['cfg']['Server']['user']), $dir); }
/** * Sets named file to be read from UploadDir. * * @param string $name file name * * @return boolean success * @access public */ public function setLocalSelectedFile($name) { if (empty($GLOBALS['cfg']['UploadDir'])) { return false; } $this->setName(Util::userDir($GLOBALS['cfg']['UploadDir']) . PMA_securePath($name)); if (@is_link($this->getName())) { $this->_error_message = __('File is a symbolic link'); $this->setName(null); return false; } if (!$this->isReadable()) { $this->_error_message = Message::error(__('File could not be read!')); $this->setName(null); return false; } return true; }