Remove asset signing for public posts
0/6
threads resolved
added scoped label
- Developer
tested with both public newsfeed and closed group activities
41 42 if (!$entity) { 37 43 return Factory::response([ 38 44 'status' => 'error', 39 'message' => 'This endpoint has been deprecated. Please use fs/v1/thumbnail', 45 'message' => 'Entity not found' 40 46 ]); 41 47 } 42 48 43 $guid = $pages[0]; 44 45 Core\Security\ACL::$ignore = true; 49 $featuresManager = new FeaturesManager(); 46 50 47 $size = isset($pages[1]) ? $pages[1] : null; 51 if ($entity->access_id !== ACCESS_PUBLIC && $featuresManager->has('cdn-jwt')) { - Owner
Use
Common\Access::Public
instead
29 29 exit; 30 30 } 31 31 32 $featuresManager = new FeaturesManager(); 32 $guid = $pages[0]; 33 33 34 if ($featuresManager->has('cdn-jwt')) { 35 error_log("{$_SERVER['REQUEST_URI']} was hit, and should not have been"); 34 Core\Security\ACL::$ignore = true; 35 36 $size = isset($pages[1]) ? $pages[1] : null; - Owner
maybe use
$pages[1] ?? null
?Edited by Mark Harding
18 18 exit; 19 19 } 20 20 21 Core\Security\ACL::$ignore = true; - Owner
Why are we ignoring acl?
22 $guid = $pages[0]; 23 $size = isset($pages[1]) ? $pages[1] : null; 24 25 $entity = Entities\Factory::build($guid); 26 27 if (!$entity) { 28 return Factory::response([ 29 'status' => 'error', 30 'message' => 'Entity not found' 31 ]); 32 } 33 21 34 $featuresManager = new FeaturesManager; 22 35 23 if ($featuresManager->has('cdn-jwt')) { 36 if ($entity->access_id !== ACCESS_PUBLIC && $featuresManager->has('cdn-jwt')) { - Owner
Use Common instead
15 15 $this->config = $config ?: Di::_()->get('Config'); 16 16 } 17 17 18 public function get($guid, $size) 18 /** 19 * @param $entity Entities\Entity|string 20 * @param $size 21 * @return bool|\ElggFile|mixed|string 22 */ 23 public function get($entity, $size) 19 24 { 20 $entity = Entities\Factory::build($guid); 25 if (is_string($entity)) { 26 $entity = Entities\Factory::build($entity); - Owner
Can we use
entitiesBuilder
for spec test sanity?
added scoped label
64 64 if (!$cmd) { 65 65 return null; 66 66 } 67 if ($entity->access_id !== ACCESS_PUBLIC) { - Owner
Common