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 abstract class AphrontStandaloneHTMLResponse extends AphrontHTMLResponse { abs..

Decoded Output download

<?php

abstract class AphrontStandaloneHTMLResponse
  extends AphrontHTMLResponse {

  abstract protected function getResources();
  abstract protected function getResponseTitle();
  abstract protected function getResponseBodyClass();
  abstract protected function getResponseBody();
  abstract protected function buildPlainTextResponseString();

  final public function buildResponseString() {
    // Check to make sure we aren't requesting this via Ajax or Conduit.
    if (isset($_REQUEST['__ajax__']) || isset($_REQUEST['__conduit__'])) {
      return (string)hsprintf('%s', $this->buildPlainTextResponseString());
    }

    $title = $this->getResponseTitle();
    $resources = $this->buildResources();
    $body_class = $this->getResponseBodyClass();
    $body = $this->getResponseBody();

    return (string)hsprintf(
<<<EOTEMPLATE
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>%s</title>
    %s
  </head>
  %s
</html>
EOTEMPLATE
      ,
      $title,
      $resources,
      phutil_tag(
        'body',
        array(
          'class' => $body_class,
        ),
        $body));
  }

  private function buildResources() {
    $paths = $this->getResources();

    $webroot = dirname(phutil_get_library_root('phabricator')).'/webroot/';

    $resources = array();
    foreach ($paths as $path) {
      $resources[] = phutil_tag(
        'style',
        array('type' => 'text/css'),
        phutil_safe_html(Filesystem::readFile($webroot.'/rsrc/'.$path)));
    }

    return phutil_implode_html("
", $resources);
  }


}
 ?>

Did this file decode correctly?

Original Code

<?php

abstract class AphrontStandaloneHTMLResponse
  extends AphrontHTMLResponse {

  abstract protected function getResources();
  abstract protected function getResponseTitle();
  abstract protected function getResponseBodyClass();
  abstract protected function getResponseBody();
  abstract protected function buildPlainTextResponseString();

  final public function buildResponseString() {
    // Check to make sure we aren't requesting this via Ajax or Conduit.
    if (isset($_REQUEST['__ajax__']) || isset($_REQUEST['__conduit__'])) {
      return (string)hsprintf('%s', $this->buildPlainTextResponseString());
    }

    $title = $this->getResponseTitle();
    $resources = $this->buildResources();
    $body_class = $this->getResponseBodyClass();
    $body = $this->getResponseBody();

    return (string)hsprintf(
<<<EOTEMPLATE
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>%s</title>
    %s
  </head>
  %s
</html>
EOTEMPLATE
      ,
      $title,
      $resources,
      phutil_tag(
        'body',
        array(
          'class' => $body_class,
        ),
        $body));
  }

  private function buildResources() {
    $paths = $this->getResources();

    $webroot = dirname(phutil_get_library_root('phabricator')).'/webroot/';

    $resources = array();
    foreach ($paths as $path) {
      $resources[] = phutil_tag(
        'style',
        array('type' => 'text/css'),
        phutil_safe_html(Filesystem::readFile($webroot.'/rsrc/'.$path)));
    }

    return phutil_implode_html("\n", $resources);
  }


}

Function Calls

None

Variables

None

Stats

MD5 11ece9ed52ffcb692b9f3651e2699dd4
Eval Count 0
Decode Time 81 ms