Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77231760
PhabricatorPhurlURLAccessController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 13, 06:33
Size
899 B
Mime Type
text/x-php
Expires
Thu, Aug 15, 06:33 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
19835821
Attached To
rPH Phabricator
PhabricatorPhurlURLAccessController.php
View Options
<?php
final
class
PhabricatorPhurlURLAccessController
extends
PhabricatorPhurlController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$id
=
$request
->
getURIData
(
'id'
);
$alias
=
$request
->
getURIData
(
'alias'
);
if
(
$id
)
{
$url
=
id
(
new
PhabricatorPhurlURLQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
executeOne
();
}
else
if
(
$alias
)
{
$url
=
id
(
new
PhabricatorPhurlURLQuery
())
->
setViewer
(
$viewer
)
->
withAliases
(
array
(
$alias
))
->
executeOne
();
}
if
(!
$url
)
{
return
new
Aphront404Response
();
}
if
(
$url
->
isValid
())
{
return
id
(
new
AphrontRedirectResponse
())
->
setURI
(
$url
->
getLongURL
())
->
setIsExternal
(
true
);
}
else
{
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/'
.
$url
->
getMonogram
());
}
}
}
Event Timeline
Log In to Comment