Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97851252
PhabricatorPasteRawController.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
Mon, Jan 6, 18:44
Size
922 B
Mime Type
text/x-php
Expires
Wed, Jan 8, 18:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23419463
Attached To
rPH Phabricator
PhabricatorPasteRawController.php
View Options
<?php
/**
* Redirect to the current raw contents of a Paste.
*
* This controller provides a stable URI for getting the current contents of
* a paste, and slightly simplifies the view controller.
*/
final
class
PhabricatorPasteRawController
extends
PhabricatorPasteController
{
public
function
shouldAllowPublic
()
{
return
true
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$id
=
$request
->
getURIData
(
'id'
);
$paste
=
id
(
new
PhabricatorPasteQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
executeOne
();
if
(!
$paste
)
{
return
new
Aphront404Response
();
}
$file
=
id
(
new
PhabricatorFileQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$paste
->
getFilePHID
()))
->
executeOne
();
if
(!
$file
)
{
return
new
Aphront400Response
();
}
return
$file
->
getRedirectResponse
();
}
}
Event Timeline
Log In to Comment