diff options
Diffstat (limited to 'build/lib/db')
-rw-r--r-- | build/lib/db/stanza.php | 25 | ||||
-rw-r--r-- | build/lib/db/stanzamapper.php | 2 |
2 files changed, 20 insertions, 7 deletions
diff --git a/build/lib/db/stanza.php b/build/lib/db/stanza.php index 6ef2f8e..76d586c 100644 --- a/build/lib/db/stanza.php +++ b/build/lib/db/stanza.php @@ -25,23 +25,33 @@ class Stanza extends Entity implements XmlSerializable } /** - * @var string $to + * @var string $to The sanitized userId of the recipient of this stanza. */ public $to; /** - * @var string $to + * @var string $from The sanitized userId of the sender of this stanza. */ public $from; /** + * @var string $to The userId (as stored in NC) of the recipient of this stanza. + */ + public $unSanitizedTo; + + /** + * @var string $from The userId (as stored in NC) of the sender of this stanza. + */ + public $unSanitizedFrom; + + /** * @var string $stanza */ public $stanza; - public function getTo() + public function getUnSanitizedTo() { - return $this->to; + return $this->unSanitizedTo; } /** @@ -59,6 +69,7 @@ class Stanza extends Entity implements XmlSerializable $userId = $userId[0]; } + $this->unSanitizedTo = $userId; $this->to = Application::sanitizeUserId($userId); if (!is_null($host_and_or_resource)) { $this->to .= '@' . $host_and_or_resource; @@ -79,15 +90,17 @@ class Stanza extends Entity implements XmlSerializable $host_and_or_resource = $userId[1]; $userId = $userId[0]; } + + $this->unSanitizedFrom = $userId; $this->from = Application::sanitizeUserId($userId); if (!is_null($host_and_or_resource)) { $this->from .= '@' . $host_and_or_resource; } } - public function getFrom() + public function getUnSanitizedFrom() { - return $this->from; + return $this->unSanitizedFrom; } public function xmlSerialize(Writer $writer) diff --git a/build/lib/db/stanzamapper.php b/build/lib/db/stanzamapper.php index f84a020..28b56f8 100644 --- a/build/lib/db/stanzamapper.php +++ b/build/lib/db/stanzamapper.php @@ -52,7 +52,7 @@ class StanzaMapper extends Mapper $sql = "INSERT INTO `*PREFIX*ojsxc_stanzas` (`to`, `from`, `stanza`) VALUES(?,?,?)"; $q = $this->db->prepare($sql); - $q->execute([$entity->getTo(), $entity->getFrom(), $xml]); + $q->execute([$entity->getUnSanitizedTo(), $entity->getUnSanitizedFrom(), $xml]); } |