Page MenuHomePhabricator

D17631.diff
No OneTemporary

D17631.diff

diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
--- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php
+++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php
@@ -1182,9 +1182,8 @@
* @task markup
*/
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- $id = $this->getID();
- return "calendar:T{$id}:{$field}:{$hash}";
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
diff --git a/src/applications/differential/storage/DifferentialInlineComment.php b/src/applications/differential/storage/DifferentialInlineComment.php
--- a/src/applications/differential/storage/DifferentialInlineComment.php
+++ b/src/applications/differential/storage/DifferentialInlineComment.php
@@ -260,8 +260,8 @@
public function getMarkupFieldKey($field) {
- // We can't use ID because synthetic comments don't have it.
- return 'DI:'.PhabricatorHash::digest($this->getContent());
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
public function newMarkupEngine($field) {
diff --git a/src/applications/legalpad/storage/LegalpadDocumentBody.php b/src/applications/legalpad/storage/LegalpadDocumentBody.php
--- a/src/applications/legalpad/storage/LegalpadDocumentBody.php
+++ b/src/applications/legalpad/storage/LegalpadDocumentBody.php
@@ -39,8 +39,8 @@
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- return 'LEGB:'.$hash;
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
public function newMarkupEngine($field) {
diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php
--- a/src/applications/maniphest/storage/ManiphestTask.php
+++ b/src/applications/maniphest/storage/ManiphestTask.php
@@ -301,9 +301,8 @@
* @task markup
*/
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- $id = $this->getID();
- return "maniphest:T{$id}:{$field}:{$hash}";
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php
--- a/src/applications/phame/storage/PhameBlog.php
+++ b/src/applications/phame/storage/PhameBlog.php
@@ -289,8 +289,8 @@
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- return $this->getPHID().':'.$field.':'.$hash;
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php
--- a/src/applications/phame/storage/PhamePost.php
+++ b/src/applications/phame/storage/PhamePost.php
@@ -241,8 +241,8 @@
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- return $this->getPHID().':'.$field.':'.$hash;
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
public function newMarkupEngine($field) {
diff --git a/src/applications/pholio/storage/PholioImage.php b/src/applications/pholio/storage/PholioImage.php
--- a/src/applications/pholio/storage/PholioImage.php
+++ b/src/applications/pholio/storage/PholioImage.php
@@ -84,8 +84,8 @@
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- return 'M:'.$hash;
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
public function newMarkupEngine($field) {
diff --git a/src/applications/pholio/storage/PholioMock.php b/src/applications/pholio/storage/PholioMock.php
--- a/src/applications/pholio/storage/PholioMock.php
+++ b/src/applications/pholio/storage/PholioMock.php
@@ -217,8 +217,8 @@
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- return 'M:'.$hash;
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
public function newMarkupEngine($field) {
diff --git a/src/applications/phriction/storage/PhrictionContent.php b/src/applications/phriction/storage/PhrictionContent.php
--- a/src/applications/phriction/storage/PhrictionContent.php
+++ b/src/applications/phriction/storage/PhrictionContent.php
@@ -68,12 +68,8 @@
* @task markup
*/
public function getMarkupFieldKey($field) {
- if ($this->shouldUseMarkupCache($field)) {
- $id = $this->getID();
- } else {
- $id = PhabricatorHash::digest($this->getMarkupText($field));
- }
- return "phriction:{$field}:{$id}";
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
diff --git a/src/applications/ponder/storage/PonderAnswer.php b/src/applications/ponder/storage/PonderAnswer.php
--- a/src/applications/ponder/storage/PonderAnswer.php
+++ b/src/applications/ponder/storage/PonderAnswer.php
@@ -136,9 +136,8 @@
// Markup interface
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- $id = $this->getID();
- return "ponder:A{$id}:{$field}:{$hash}";
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
public function getMarkupText($field) {
diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php
--- a/src/applications/ponder/storage/PonderQuestion.php
+++ b/src/applications/ponder/storage/PonderQuestion.php
@@ -155,9 +155,8 @@
// Markup interface
public function getMarkupFieldKey($field) {
- $hash = PhabricatorHash::digest($this->getMarkupText($field));
- $id = $this->getID();
- return "ponder:Q{$id}:{$field}:{$hash}";
+ $content = $this->getMarkupText($field);
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
public function getMarkupText($field) {
diff --git a/src/applications/releeph/field/specification/ReleephFieldSpecification.php b/src/applications/releeph/field/specification/ReleephFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephFieldSpecification.php
@@ -236,12 +236,14 @@
}
final public function getMarkupFieldKey($field) {
- return sprintf(
+ $content = sprintf(
'%s:%s:%s:%s',
$this->getReleephRequest()->getPHID(),
$this->getStorageKey(),
$field,
- PhabricatorHash::digest($this->getMarkupText($field)));
+ $this->getMarkupText($field));
+
+ return PhabricatorMarkupEngine::digestRemarkupContent($this, $content);
}
final public function newMarkupEngine($field) {
diff --git a/src/infrastructure/markup/PhabricatorMarkupEngine.php b/src/infrastructure/markup/PhabricatorMarkupEngine.php
--- a/src/infrastructure/markup/PhabricatorMarkupEngine.php
+++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php
@@ -694,4 +694,19 @@
->execute();
}
+ public static function digestRemarkupContent($object, $content) {
+ $parts = array();
+ $parts[] = get_class($object);
+
+ if ($object instanceof PhabricatorLiskDAO) {
+ $parts[] = $object->getID();
+ }
+
+ $parts[] = $content;
+
+ $message = implode("\n", $parts);
+
+ return PhabricatorHash::digestWithNamedKey($message, 'remarkup');
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 22, 9:15 PM (2 d, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7724949
Default Alt Text
D17631.diff (7 KB)

Event Timeline