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 Aphront403Response extends AphrontHTMLResponse { private $forbiddenT..

Decoded Output download

<?php

final class Aphront403Response extends AphrontHTMLResponse {

  private $forbiddenText;
  public function setForbiddenText($text) {
    $this->forbiddenText = $text;
    return $this;
  }
  private function getForbiddenText() {
    return $this->forbiddenText;
  }

  public function getHTTPResponseCode() {
    return 403;
  }

  public function buildResponseString() {
    $forbidden_text = $this->getForbiddenText();
    if (!$forbidden_text) {
      $forbidden_text =
        pht('You do not have privileges to access the requested page.');
    }

    $request = $this->getRequest();
    $user = $request->getUser();

    $dialog = id(new AphrontDialogView())
      ->setUser($user)
      ->setTitle(pht('403 Forbidden'))
      ->addCancelButton('/', pht('Yikes!'))
      ->appendParagraph($forbidden_text);

    $view = id(new PhabricatorStandardPageView())
      ->setTitle(pht('403 Forbidden'))
      ->setRequest($request)
      ->setDeviceReady(true)
      ->appendChild($dialog);

    return $view->render();
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class Aphront403Response extends AphrontHTMLResponse {

  private $forbiddenText;
  public function setForbiddenText($text) {
    $this->forbiddenText = $text;
    return $this;
  }
  private function getForbiddenText() {
    return $this->forbiddenText;
  }

  public function getHTTPResponseCode() {
    return 403;
  }

  public function buildResponseString() {
    $forbidden_text = $this->getForbiddenText();
    if (!$forbidden_text) {
      $forbidden_text =
        pht('You do not have privileges to access the requested page.');
    }

    $request = $this->getRequest();
    $user = $request->getUser();

    $dialog = id(new AphrontDialogView())
      ->setUser($user)
      ->setTitle(pht('403 Forbidden'))
      ->addCancelButton('/', pht('Yikes!'))
      ->appendParagraph($forbidden_text);

    $view = id(new PhabricatorStandardPageView())
      ->setTitle(pht('403 Forbidden'))
      ->setRequest($request)
      ->setDeviceReady(true)
      ->appendChild($dialog);

    return $view->render();
  }

}

Function Calls

None

Variables

None

Stats

MD5 7e544958c4010b6d98f0b9fa65303f75
Eval Count 0
Decode Time 103 ms