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 DifferentialChangesSinceLastUpdateField extends DifferentialCustomFie..

Decoded Output download

<?php

final class DifferentialChangesSinceLastUpdateField
  extends DifferentialCustomField {

  public function getFieldKey() {
    return 'differential:changes-since-last-update';
  }

  public function getFieldName() {
    return pht('Changes Since Last Update');
  }

  public function getFieldDescription() {
    return pht('Links to changes since the last update in email.');
  }

  public function shouldAppearInTransactionMail() {
    return true;
  }

  public function updateTransactionMailBody(
    PhabricatorMetaMTAMailBody $body,
    PhabricatorApplicationTransactionEditor $editor,
    array $xactions) {

    if ($editor->isFirstBroadcast()) {
      return;
    }

    if ($editor->getIsCloseByCommit()) {
      return;
    }

    $xaction = $editor->getDiffUpdateTransaction($xactions);
    if (!$xaction) {
      return;
    }

    $original = id(new DifferentialDiffQuery())
      ->setViewer($this->getViewer())
      ->withPHIDs(array($xaction->getOldValue()))
      ->executeOne();
    if (!$original) {
      return;
    }

    $revision = $this->getObject();
    $current = $revision->getActiveDiff();

    $old_id = $original->getID();
    $new_id = $current->getID();

    $uri = '/'.$revision->getMonogram().'?vs='.$old_id.'&id='.$new_id;
    $uri = PhabricatorEnv::getProductionURI($uri);

    $body->addLinkSection(pht('CHANGES SINCE LAST UPDATE'), $uri);
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class DifferentialChangesSinceLastUpdateField
  extends DifferentialCustomField {

  public function getFieldKey() {
    return 'differential:changes-since-last-update';
  }

  public function getFieldName() {
    return pht('Changes Since Last Update');
  }

  public function getFieldDescription() {
    return pht('Links to changes since the last update in email.');
  }

  public function shouldAppearInTransactionMail() {
    return true;
  }

  public function updateTransactionMailBody(
    PhabricatorMetaMTAMailBody $body,
    PhabricatorApplicationTransactionEditor $editor,
    array $xactions) {

    if ($editor->isFirstBroadcast()) {
      return;
    }

    if ($editor->getIsCloseByCommit()) {
      return;
    }

    $xaction = $editor->getDiffUpdateTransaction($xactions);
    if (!$xaction) {
      return;
    }

    $original = id(new DifferentialDiffQuery())
      ->setViewer($this->getViewer())
      ->withPHIDs(array($xaction->getOldValue()))
      ->executeOne();
    if (!$original) {
      return;
    }

    $revision = $this->getObject();
    $current = $revision->getActiveDiff();

    $old_id = $original->getID();
    $new_id = $current->getID();

    $uri = '/'.$revision->getMonogram().'?vs='.$old_id.'&id='.$new_id;
    $uri = PhabricatorEnv::getProductionURI($uri);

    $body->addLinkSection(pht('CHANGES SINCE LAST UPDATE'), $uri);
  }

}

Function Calls

None

Variables

None

Stats

MD5 9315f96aef84f495b9757cbfe8fd001f
Eval Count 0
Decode Time 80 ms