Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F439422
PhabricatorPhurlURLAccessController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
960 B
Referenced Files
None
Subscribers
None
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
());
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 4:00 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
63731
Default Alt Text
PhabricatorPhurlURLAccessController.php (960 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment