Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php final class PhabricatorFileDocumentController extends PhabricatorFileController {..

Decoded Output download

<?php

final class PhabricatorFileDocumentController
  extends PhabricatorFileController {

  public function shouldAllowPublic() {
    return true;
  }

  public function handleRequest(AphrontRequest $request) {
    $engine = id(new PhabricatorFileDocumentRenderingEngine())
      ->setRequest($request)
      ->setController($this);

    $viewer = $request->getViewer();

    $file_phid = $request->getURIData('phid');

    $file = id(new PhabricatorFileQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($file_phid))
      ->executeOne();
    if (!$file) {
      return $engine->newErrorResponse(
        pht(
          'This file ("%s") does not exist or could not be loaded.',
          $file_phid));
    }

    $ref = id(new PhabricatorDocumentRef())
      ->setFile($file);

    return $engine->newRenderResponse($ref);
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorFileDocumentController
  extends PhabricatorFileController {

  public function shouldAllowPublic() {
    return true;
  }

  public function handleRequest(AphrontRequest $request) {
    $engine = id(new PhabricatorFileDocumentRenderingEngine())
      ->setRequest($request)
      ->setController($this);

    $viewer = $request->getViewer();

    $file_phid = $request->getURIData('phid');

    $file = id(new PhabricatorFileQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($file_phid))
      ->executeOne();
    if (!$file) {
      return $engine->newErrorResponse(
        pht(
          'This file ("%s") does not exist or could not be loaded.',
          $file_phid));
    }

    $ref = id(new PhabricatorDocumentRef())
      ->setFile($file);

    return $engine->newRenderResponse($ref);
  }

}

Function Calls

None

Variables

None

Stats

MD5 39d224759ce2bc935277b8a62632c447
Eval Count 0
Decode Time 89 ms