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 PhabricatorRateLimitRequestExceptionHandler extends PhabricatorReques..

Decoded Output download

<?php

final class PhabricatorRateLimitRequestExceptionHandler
  extends PhabricatorRequestExceptionHandler {

  public function getRequestExceptionHandlerPriority() {
    return 300000;
  }

  public function getRequestExceptionHandlerDescription() {
    return pht(
      'Handles action rate limiting exceptions which occur when a user '.
      'does something too frequently.');
  }

  public function canHandleRequestThrowable(
    AphrontRequest $request,
    $throwable) {

    if (!$this->isPhabricatorSite($request)) {
      return false;
    }

    return ($throwable instanceof PhabricatorSystemActionRateLimitException);
  }

  public function handleRequestThrowable(
    AphrontRequest $request,
    $throwable) {

    $viewer = $this->getViewer($request);

    return id(new AphrontDialogView())
      ->setTitle(pht('Slow Down!'))
      ->setUser($viewer)
      ->setErrors(array(pht('You are being rate limited.')))
      ->appendParagraph($throwable->getMessage())
      ->appendParagraph($throwable->getRateExplanation())
      ->addCancelButton('/', pht('Okaaaaaaaaaaaaaay...'));
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorRateLimitRequestExceptionHandler
  extends PhabricatorRequestExceptionHandler {

  public function getRequestExceptionHandlerPriority() {
    return 300000;
  }

  public function getRequestExceptionHandlerDescription() {
    return pht(
      'Handles action rate limiting exceptions which occur when a user '.
      'does something too frequently.');
  }

  public function canHandleRequestThrowable(
    AphrontRequest $request,
    $throwable) {

    if (!$this->isPhabricatorSite($request)) {
      return false;
    }

    return ($throwable instanceof PhabricatorSystemActionRateLimitException);
  }

  public function handleRequestThrowable(
    AphrontRequest $request,
    $throwable) {

    $viewer = $this->getViewer($request);

    return id(new AphrontDialogView())
      ->setTitle(pht('Slow Down!'))
      ->setUser($viewer)
      ->setErrors(array(pht('You are being rate limited.')))
      ->appendParagraph($throwable->getMessage())
      ->appendParagraph($throwable->getRateExplanation())
      ->addCancelButton('/', pht('Okaaaaaaaaaaaaaay...'));
  }

}

Function Calls

None

Variables

None

Stats

MD5 04a8ba34f854e5dd3277450d076db5e5
Eval Count 0
Decode Time 109 ms