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 AphrontEpochHTTPParameterType extends AphrontHTTPParameterType { p..

Decoded Output download

<?php

final class AphrontEpochHTTPParameterType
  extends AphrontHTTPParameterType {

  private $allowNull;

  public function setAllowNull($allow_null) {
    $this->allowNull = $allow_null;
    return $this;
  }

  public function getAllowNull() {
    return $this->allowNull;
  }

  protected function getParameterExists(AphrontRequest $request, $key) {
    return $request->getExists($key) ||
           $request->getExists($key.'_d');
  }

  protected function getParameterValue(AphrontRequest $request, $key) {
    $value = AphrontFormDateControlValue::newFromRequest($request, $key);

    if ($this->getAllowNull()) {
      $value->setOptional(true);
    }

    return $value;
  }

  protected function getParameterTypeName() {
    return 'epoch';
  }

  protected function getParameterFormatDescriptions() {
    return array(
      pht('An epoch timestamp, as an integer.'),
      pht('An absolute date, as a string.'),
      pht('A relative date, as a string.'),
      pht('Separate date and time inputs, as strings.'),
    );
  }

  protected function getParameterExamples() {
    return array(
      'v=1460050737',
      'v=2022-01-01',
      'v=yesterday',
      'v_d=2022-01-01&v_t=12:34',
    );
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class AphrontEpochHTTPParameterType
  extends AphrontHTTPParameterType {

  private $allowNull;

  public function setAllowNull($allow_null) {
    $this->allowNull = $allow_null;
    return $this;
  }

  public function getAllowNull() {
    return $this->allowNull;
  }

  protected function getParameterExists(AphrontRequest $request, $key) {
    return $request->getExists($key) ||
           $request->getExists($key.'_d');
  }

  protected function getParameterValue(AphrontRequest $request, $key) {
    $value = AphrontFormDateControlValue::newFromRequest($request, $key);

    if ($this->getAllowNull()) {
      $value->setOptional(true);
    }

    return $value;
  }

  protected function getParameterTypeName() {
    return 'epoch';
  }

  protected function getParameterFormatDescriptions() {
    return array(
      pht('An epoch timestamp, as an integer.'),
      pht('An absolute date, as a string.'),
      pht('A relative date, as a string.'),
      pht('Separate date and time inputs, as strings.'),
    );
  }

  protected function getParameterExamples() {
    return array(
      'v=1460050737',
      'v=2022-01-01',
      'v=yesterday',
      'v_d=2022-01-01&v_t=12:34',
    );
  }

}

Function Calls

None

Variables

None

Stats

MD5 1c6dacfce23adf288adfb15fdfe22f68
Eval Count 0
Decode Time 94 ms