当前位置: 首页>>代码示例>>PHP>>正文


PHP CKFinder_Connector_Utils_FileSystem::checkFolderPath方法代码示例

本文整理汇总了PHP中CKFinder_Connector_Utils_FileSystem::checkFolderPath方法的典型用法代码示例。如果您正苦于以下问题:PHP CKFinder_Connector_Utils_FileSystem::checkFolderPath方法的具体用法?PHP CKFinder_Connector_Utils_FileSystem::checkFolderPath怎么用?PHP CKFinder_Connector_Utils_FileSystem::checkFolderPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CKFinder_Connector_Utils_FileSystem的用法示例。


在下文中一共展示了CKFinder_Connector_Utils_FileSystem::checkFolderPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkOneFile

 /**
  * Checks given file for security
  *
  * @param  SplFileInfo $file
  * @access protected
  * @return bool
  */
 protected function checkOneFile($file)
 {
     $resourceTypeInfo = $this->_currentFolder->getResourceTypeConfig();
     $_aclConfig = $this->_config->getAccessControlConfig();
     $directory = str_replace('\\', '/', $resourceTypeInfo->getDirectory());
     $fileName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($file->getFilename());
     if ($this->_config->forceAscii()) {
         $fileName = CKFinder_Connector_Utils_FileSystem::convertToAscii($fileName);
     }
     $pathName = str_replace('\\', '/', pathinfo($file->getPathname(), PATHINFO_DIRNAME));
     $pathName = CKFinder_Connector_Utils_FileSystem::convertToFilesystemEncoding($pathName);
     // acl
     $aclMask = $_aclConfig->getComputedMask($this->_currentFolder->getResourceTypeName(), str_ireplace($directory, '', $pathName));
     $isAuthorized = ($aclMask & CKFINDER_CONNECTOR_ACL_FILE_VIEW) == CKFINDER_CONNECTOR_ACL_FILE_VIEW;
     if (!$isAuthorized) {
         return false;
     }
     // if it is a folder fileName represents the dir
     if ($file->isDir() && (!CKFinder_Connector_Utils_FileSystem::checkFolderPath($fileName) || $resourceTypeInfo->checkIsHiddenPath($fileName))) {
         return false;
     }
     // folder name
     if (!CKFinder_Connector_Utils_FileSystem::checkFolderPath($pathName)) {
         return false;
     }
     // is hidden
     if ($resourceTypeInfo->checkIsHiddenPath($pathName) || $resourceTypeInfo->checkIsHiddenFile($fileName)) {
         return false;
     }
     // extension
     if (!$resourceTypeInfo->checkExtension($fileName) || !CKFinder_Connector_Utils_FileSystem::checkFileName($fileName)) {
         return false;
     }
     return true;
 }
开发者ID:jambik,项目名称:ikkf05,代码行数:42,代码来源:plugin.php


注:本文中的CKFinder_Connector_Utils_FileSystem::checkFolderPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。