Permalink
Browse files

Fix isWriteable hidden call

Test getContextOptions() against null, not ""
  • Loading branch information...
1 parent 06f3f13 commit ae2bbd9079c42a9fe6adbc25c41d91e7876b3b04 @cdujeu cdujeu committed Jun 7, 2016
@@ -722,7 +722,7 @@ public function switchAction($action, $httpVars, $fileVars, ContextInterface $ct
$meta = array();
try{
$metaSources = $repositoryObject->getContextOption($ctx, "META_SOURCES");
- if($metaSources !== ""){
+ if($metaSources !== null){
$meta = array_keys($metaSources);
}
}catch(\Exception $e){
@@ -274,9 +274,10 @@ protected function saveMetaFileData($ajxpNode, $scope, $userId)
$metaFile = $this->globalMetaFile."_".$repositoryId;
$metaFile = $this->updateSecurityScope($metaFile, $ajxpNode->getRepositoryId(), $ajxpNode->getUserId());
}
+ $metFileNode = new AJXP_Node($metaFile);
if($scope==AJXP_METADATA_SCOPE_REPOSITORY
- || (@is_file($metaFile) && call_user_func(array($this->accessDriver, "isWriteable"), $metaFile))
- || call_user_func(array($this->accessDriver, "isWriteable"), dirname($metaFile)) ){
+ || (@is_file($metaFile) && call_user_func(array($this->accessDriver, "isWriteable"), $metFileNode))
+ || call_user_func(array($this->accessDriver, "isWriteable"), $metFileNode->getParent()) ){
if (is_array(self::$metaCache) && count(self::$metaCache)) {
if (!isset(self::$fullMetaCache[$metaFile])) {
self::$fullMetaCache[$metaFile] = array();

0 comments on commit ae2bbd9

Please sign in to comment.