1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Mark external -> external redirects in Phame to canonicalize URIs as "external"

Summary: Ref T9897. If you visit `/post/123/spoderman/` it will try to redirect you to `/post/123/spiderman/`, but currently only internal views work because these redirects aren't marked as safe/external.

Test Plan: Visited a misspelled/out-of-date URI on an external blog view, got a good redirect.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14741
This commit is contained in:
epriestley 2015-12-11 08:28:25 -08:00
parent 9e78f33847
commit 20d2652d03

View file

@ -129,7 +129,14 @@ abstract class PhameLiveController extends PhameController {
$uri = $post->getViewURI();
}
return id(new AphrontRedirectResponse())->setURI($uri);
$response = id(new AphrontRedirectResponse())
->setURI($uri);
if ($is_external) {
$response->setIsExternal(true);
}
return $response;
}
}