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 ConpherenceReplyHandler extends PhabricatorMailReplyHandler { privat..

Decoded Output download

<?php

final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler {

  private $mailAddedParticipantPHIDs;

  public function setMailAddedParticipantPHIDs(array $phids) {
    $this->mailAddedParticipantPHIDs = $phids;
    return $this;
  }
  public function getMailAddedParticipantPHIDs() {
    return $this->mailAddedParticipantPHIDs;
  }

  public function validateMailReceiver($mail_receiver) {
    if (!($mail_receiver instanceof ConpherenceThread)) {
      throw new Exception(
        pht(
          'Mail receiver is not a %s!', '
          ConpherenceThread'));
    }
  }

  public function getPrivateReplyHandlerEmailAddress(PhabricatorUser $user) {
    return $this->getDefaultPrivateReplyHandlerEmailAddress($user, 'Z');
  }

  public function getPublicReplyHandlerEmailAddress() {
    return $this->getDefaultPublicReplyHandlerEmailAddress('Z');
  }

  protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) {
    $conpherence = $this->getMailReceiver();
    $user = $this->getActor();
    if (!$conpherence->getPHID()) {
      $conpherence
        ->attachParticipants(array());
    } else {
      $participants = id(new ConpherenceParticipant())
        ->loadAllWhere('conpherencePHID = %s', $conpherence->getPHID());
      $participants = mpull($participants, null, 'getParticipantPHID');
      $conpherence->attachParticipants($participants);
    }

    $content_source = $mail->newContentSource();

    $editor = id(new ConpherenceEditor())
      ->setActor($user)
      ->setContentSource($content_source)
      ->setParentMessageID($mail->getMessageID());

    $body = $mail->getCleanTextBody();
    $body = $this->enhanceBodyWithAttachments($body, $mail->getAttachments());

    $xactions = array();
    if ($this->getMailAddedParticipantPHIDs()) {
      $xactions[] = id(new ConpherenceTransaction())
        ->setTransactionType(
          ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE)
        ->setNewValue(array('+' => $this->getMailAddedParticipantPHIDs()));
    }

    $xactions = array_merge(
      $xactions,
      $editor->generateTransactionsFromText(
        $user,
        $conpherence,
        $body));

    $editor->applyTransactions($conpherence, $xactions);

    return $conpherence;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler {

  private $mailAddedParticipantPHIDs;

  public function setMailAddedParticipantPHIDs(array $phids) {
    $this->mailAddedParticipantPHIDs = $phids;
    return $this;
  }
  public function getMailAddedParticipantPHIDs() {
    return $this->mailAddedParticipantPHIDs;
  }

  public function validateMailReceiver($mail_receiver) {
    if (!($mail_receiver instanceof ConpherenceThread)) {
      throw new Exception(
        pht(
          'Mail receiver is not a %s!', '
          ConpherenceThread'));
    }
  }

  public function getPrivateReplyHandlerEmailAddress(PhabricatorUser $user) {
    return $this->getDefaultPrivateReplyHandlerEmailAddress($user, 'Z');
  }

  public function getPublicReplyHandlerEmailAddress() {
    return $this->getDefaultPublicReplyHandlerEmailAddress('Z');
  }

  protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) {
    $conpherence = $this->getMailReceiver();
    $user = $this->getActor();
    if (!$conpherence->getPHID()) {
      $conpherence
        ->attachParticipants(array());
    } else {
      $participants = id(new ConpherenceParticipant())
        ->loadAllWhere('conpherencePHID = %s', $conpherence->getPHID());
      $participants = mpull($participants, null, 'getParticipantPHID');
      $conpherence->attachParticipants($participants);
    }

    $content_source = $mail->newContentSource();

    $editor = id(new ConpherenceEditor())
      ->setActor($user)
      ->setContentSource($content_source)
      ->setParentMessageID($mail->getMessageID());

    $body = $mail->getCleanTextBody();
    $body = $this->enhanceBodyWithAttachments($body, $mail->getAttachments());

    $xactions = array();
    if ($this->getMailAddedParticipantPHIDs()) {
      $xactions[] = id(new ConpherenceTransaction())
        ->setTransactionType(
          ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE)
        ->setNewValue(array('+' => $this->getMailAddedParticipantPHIDs()));
    }

    $xactions = array_merge(
      $xactions,
      $editor->generateTransactionsFromText(
        $user,
        $conpherence,
        $body));

    $editor->applyTransactions($conpherence, $xactions);

    return $conpherence;
  }

}

Function Calls

None

Variables

None

Stats

MD5 56d2afcde5903b0e49ba8663073e6569
Eval Count 0
Decode Time 77 ms