Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F483566
PhabricatorPasteRawController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
922 B
Referenced Files
None
Subscribers
None
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
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 3:07 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
83248
Default Alt Text
PhabricatorPasteRawController.php (922 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment