Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix #847
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 5, 2015
1 parent b256426 commit 29e59c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions core/src/core/classes/class.ContentFilter.php
Expand Up @@ -107,4 +107,18 @@ public function movePath($oldPath, $newPath){

}

/**
* @return Return public data as array, pre-utf8 encoded
*/
public function toArray(){
$data = array("filters" => array(), "virtualPaths" => array());
foreach($this->filters as $k => $v){
$data["filters"][SystemTextEncoding::toUTF8($k)] = SystemTextEncoding::toUTF8($v);
}
foreach($this->virtualPaths as $k => $v){
$data["virtualPaths"][SystemTextEncoding::toUTF8($k)] = SystemTextEncoding::toUTF8($v);
}
return $data;
}

}
6 changes: 5 additions & 1 deletion core/src/plugins/action.share/class.ShareCenter.php
Expand Up @@ -2466,6 +2466,10 @@ public function shareToJson($shareId, $shareData, $node = null){
$sharedEntries = $this->computeSharedRepositoryAccessRights($repoId, true, null);
}

$cFilter = $repo->getContentFilter();
if(!empty($cFilter)){
$cFilter = $cFilter->toArray();
}
$jsonData = array(
"repositoryId" => $repoId,
"users_number" => AuthService::countUsersForRepository($repoId),
Expand All @@ -2474,7 +2478,7 @@ public function shareToJson($shareId, $shareData, $node = null){
"entries" => $sharedEntries,
"element_watch" => $elementWatch,
"repository_url"=> AJXP_Utils::detectServerURL(true)."?goto=". $repo->getSlug() ."/",
"content_filter"=> $repo->getContentFilter()
"content_filter"=> $cFilter
);
if (isSet($minisiteData)) {
if(!empty($minisiteData["DOWNLOAD_LIMIT"]) && !$dlDisabled){
Expand Down

0 comments on commit 29e59c6

Please sign in to comment.