@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix external redirect flagging issue with image thumbnails

Summary: Fixes T5894. This needs some improvement when we lay in real CDN stuff, but should get all the cases right for now.

Test Plan: Thumbnails work properly again.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5894

Differential Revision: https://secure.phabricator.com/D10299

+15 -1
+15 -1
src/applications/files/controller/PhabricatorFileTransformController.php
··· 149 149 // TODO: We could just delegate to the file view controller instead, 150 150 // which would save the client a roundtrip, but is slightly more complex. 151 151 $uri = $file->getBestURI(); 152 - return id(new AphrontRedirectResponse())->setURI($uri); 152 + 153 + // TODO: This is a bit iffy. Sometimes, getBestURI() returns a CDN URI 154 + // (if the file is a viewable image) and sometimes a local URI (if not). 155 + // For now, just detect which one we got and configure the response 156 + // appropriately. In the long run, if this endpoint is served from a CDN 157 + // domain, we can't issue a local redirect to an info URI (which is not 158 + // present on the CDN domain). We probably never actually issue local 159 + // redirects here anyway, since we only ever transform viewable images 160 + // right now. 161 + 162 + $is_external = strlen(id(new PhutilURI($uri))->getDomain()); 163 + 164 + return id(new AphrontRedirectResponse()) 165 + ->setIsExternal($is_external) 166 + ->setURI($uri); 153 167 } 154 168 155 169 private function executePreviewTransform(PhabricatorFile $file, $size) {