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 PhabricatorPasteFulltextEngine extends PhabricatorFulltextEngine { ..

Decoded Output download

<?php

final class PhabricatorPasteFulltextEngine
  extends PhabricatorFulltextEngine {

  protected function buildAbstractDocument(
    PhabricatorSearchAbstractDocument $document,
    $object) {

    $paste = id(new PhabricatorPasteQuery())
      ->setViewer($this->getViewer())
      ->withPHIDs(array($object->getPHID()))
      ->needContent(true)
      ->executeOne();

    $document->setDocumentTitle($paste->getTitle());

    $document->addRelationship(
      $paste->isArchived()
        ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
        : PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
      $paste->getPHID(),
      PhabricatorPastePastePHIDType::TYPECONST,
      PhabricatorTime::getNow());

    $document->addField(
      PhabricatorSearchDocumentFieldType::FIELD_BODY,
      $paste->getContent());

    $document->addRelationship(
      PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
      $paste->getAuthorPHID(),
      PhabricatorPeopleUserPHIDType::TYPECONST,
      $paste->getDateCreated());
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorPasteFulltextEngine
  extends PhabricatorFulltextEngine {

  protected function buildAbstractDocument(
    PhabricatorSearchAbstractDocument $document,
    $object) {

    $paste = id(new PhabricatorPasteQuery())
      ->setViewer($this->getViewer())
      ->withPHIDs(array($object->getPHID()))
      ->needContent(true)
      ->executeOne();

    $document->setDocumentTitle($paste->getTitle());

    $document->addRelationship(
      $paste->isArchived()
        ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
        : PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
      $paste->getPHID(),
      PhabricatorPastePastePHIDType::TYPECONST,
      PhabricatorTime::getNow());

    $document->addField(
      PhabricatorSearchDocumentFieldType::FIELD_BODY,
      $paste->getContent());

    $document->addRelationship(
      PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
      $paste->getAuthorPHID(),
      PhabricatorPeopleUserPHIDType::TYPECONST,
      $paste->getDateCreated());
  }

}

Function Calls

None

Variables

None

Stats

MD5 081bc47e36cd5192b66eeadbf5310807
Eval Count 0
Decode Time 114 ms