diff options
-rw-r--r-- | Zotlabs/Lib/Apps.php | 11 | ||||
-rw-r--r-- | Zotlabs/Module/Appman.php | 6 | ||||
-rw-r--r-- | library/jsonld/jsonld.php | 10 | ||||
-rwxr-xr-x | util/dcp | 2 |
4 files changed, 21 insertions, 8 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index aef6756b5..c54a5a111 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -546,6 +546,17 @@ class Apps { } static public function app_install($uid,$app) { + + if(! is_array($app)) { + $r = q("select * from app where app_name = '%s' and app_channel = 0", + dbesc($app) + ); + if(! $r) + return false; + + $app = self::app_encode($r[0]); + } + $app['uid'] = $uid; if(self::app_installed($uid,$app,true)) diff --git a/Zotlabs/Module/Appman.php b/Zotlabs/Module/Appman.php index 3ebafafa4..f50dcc2ab 100644 --- a/Zotlabs/Module/Appman.php +++ b/Zotlabs/Module/Appman.php @@ -113,10 +113,12 @@ class Appman extends \Zotlabs\Web\Controller { if($r) { $app = $r[0]; - $term = q("select * from term where otype = %d and oid = %d", + $term = q("select * from term where otype = %d and oid = %d and uid = %d", intval(TERM_OBJ_APP), - intval($r[0]['id']) + intval($r[0]['id']), + intval(local_channel()) ); + if($term) { $app['categories'] = ''; foreach($term as $t) { diff --git a/library/jsonld/jsonld.php b/library/jsonld/jsonld.php index 28b3e7ce3..8cd3e7ceb 100644 --- a/library/jsonld/jsonld.php +++ b/library/jsonld/jsonld.php @@ -4301,7 +4301,7 @@ class JsonLdProcessor { sort($nquads); // cache and return hashed quads - $hash = $bnodes->{$id}->hash = sha1(implode($nquads)); + $hash = $bnodes->{$id}->hash = hash('sha256',implode($nquads)); return $hash; } @@ -4320,8 +4320,8 @@ class JsonLdProcessor { * @return stdClass the hash and path namer used. */ protected function _hashPaths($id, $bnodes, $namer, $path_namer) { - // create SHA-1 digest - $md = hash_init('sha1'); + // create digest + $md = hash_init('sha256'); // group adjacent bnodes by hash, keep properties and references separate $groups = new stdClass(); @@ -4350,7 +4350,7 @@ class JsonLdProcessor { } // hash direction, property, and bnode name/hash - $group_md = hash_init('sha1'); + $group_md = hash_init('sha256'); hash_update($group_md, $direction); hash_update($group_md, $quad->predicate->value); hash_update($group_md, $name); @@ -4433,7 +4433,7 @@ class JsonLdProcessor { $path_namer = $chosen_namer; } - // return SHA-1 hash and path namer + // return hash and path namer return (object)array( 'hash' => hash_final($md), 'pathNamer' => $path_namer); } @@ -28,7 +28,7 @@ if($argc < 3) { if(strpos($dstfile,'store/') === 0) $dstfile = substr($dstfile,6); - if(strpos($dstfile,'/')) + if(strpos($dstfile,'/')) { $nick = substr($dstfile,0,strpos($dstfile,'/')); $dstfile = substr($dstfile,strlen($nick)+1); } |