Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101668872
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
Wed, Feb 12, 15:14
Size
899 B
Mime Type
text/x-php
Expires
Fri, Feb 14, 15:14 (2 d)
Engine
blob
Format
Raw Data
Handle
24208817
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