Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110514825
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
Sat, Apr 26, 16:26
Size
960 B
Mime Type
text/x-php
Expires
Mon, Apr 28, 16:26 (2 d)
Engine
blob
Format
Raw Data
Handle
25825470
Attached To
rPH Phabricator
PhabricatorPhurlURLAccessController.php
View Options
<?php
final
class
PhabricatorPhurlURLAccessController
extends
PhabricatorPhurlController
{
public
function
shouldAllowPublic
()
{
return
true
;
}
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