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 PhrictionDocumentPublishedHeraldField extends PhrictionDocumentHerald..

Decoded Output download

<?php

final class PhrictionDocumentPublishedHeraldField
  extends PhrictionDocumentHeraldField {

  const FIELDCONST = 'phriction.document.published';

  public function getHeraldFieldName() {
    return pht('Published document changed');
  }

  public function getFieldGroupKey() {
    return HeraldTransactionsFieldGroup::FIELDGROUPKEY;
  }

  public function getHeraldFieldValue($object) {
    // The published document changes if we apply a "publish" transaction
    // (which points the published document pointer at new content) or if we
    // apply a "content" transaction.

    // When a change affects only the draft document, it applies as a "draft"
    // transaction.

    $type_content = PhrictionDocumentContentTransaction::TRANSACTIONTYPE;
    $type_publish = PhrictionDocumentPublishTransaction::TRANSACTIONTYPE;

    if ($this->hasAppliedTransactionOfType($type_content)) {
      return true;
    }

    if ($this->hasAppliedTransactionOfType($type_publish)) {
      return true;
    }

    return false;
  }

  protected function getHeraldFieldStandardType() {
    return self::STANDARD_BOOL;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhrictionDocumentPublishedHeraldField
  extends PhrictionDocumentHeraldField {

  const FIELDCONST = 'phriction.document.published';

  public function getHeraldFieldName() {
    return pht('Published document changed');
  }

  public function getFieldGroupKey() {
    return HeraldTransactionsFieldGroup::FIELDGROUPKEY;
  }

  public function getHeraldFieldValue($object) {
    // The published document changes if we apply a "publish" transaction
    // (which points the published document pointer at new content) or if we
    // apply a "content" transaction.

    // When a change affects only the draft document, it applies as a "draft"
    // transaction.

    $type_content = PhrictionDocumentContentTransaction::TRANSACTIONTYPE;
    $type_publish = PhrictionDocumentPublishTransaction::TRANSACTIONTYPE;

    if ($this->hasAppliedTransactionOfType($type_content)) {
      return true;
    }

    if ($this->hasAppliedTransactionOfType($type_publish)) {
      return true;
    }

    return false;
  }

  protected function getHeraldFieldStandardType() {
    return self::STANDARD_BOOL;
  }

}

Function Calls

None

Variables

None

Stats

MD5 9510ea8659f1c155eea6f53dad857e55
Eval Count 0
Decode Time 95 ms