Merge pull request #13819 from nextcloud/bugfix/noid/unify-html-encoding-handling-with-other-ros-apps
Unify the HTML encoding handling with other ROS apps
This commit is contained in:
commit
668b706f02
3 changed files with 84 additions and 1 deletions
|
@ -204,7 +204,6 @@ class Provider implements IProvider {
|
||||||
try {
|
try {
|
||||||
$comment = $this->commentsManager->get((string) $commentId);
|
$comment = $this->commentsManager->get((string) $commentId);
|
||||||
$message = $comment->getMessage();
|
$message = $comment->getMessage();
|
||||||
$message = str_replace(['<', '>', "\n"], ['<', '>', '<br />'], $message);
|
|
||||||
|
|
||||||
$mentionCount = 1;
|
$mentionCount = 1;
|
||||||
$mentions = [];
|
$mentions = [];
|
||||||
|
|
|
@ -100,6 +100,17 @@ interface IEvent {
|
||||||
public function setSubject(string $subject, array $parameters = []): self;
|
public function setSubject(string $subject, array $parameters = []): self;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set a parsed subject
|
||||||
|
*
|
||||||
|
* HTML is not allowed in the parsed subject and will be escaped
|
||||||
|
* automatically by the clients. You can use the RichObjectString system
|
||||||
|
* provided by the Nextcloud server to highlight important parameters via
|
||||||
|
* the setRichSubject method, but make sure, that a plain text message is
|
||||||
|
* always set via setParsedSubject, to support clients which can not handle
|
||||||
|
* rich strings.
|
||||||
|
*
|
||||||
|
* See https://github.com/nextcloud/server/issues/1706 for more information.
|
||||||
|
*
|
||||||
* @param string $subject
|
* @param string $subject
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \InvalidArgumentException if the subject is invalid
|
* @throws \InvalidArgumentException if the subject is invalid
|
||||||
|
@ -114,6 +125,16 @@ interface IEvent {
|
||||||
public function getParsedSubject(): string;
|
public function getParsedSubject(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set a RichObjectString subject
|
||||||
|
*
|
||||||
|
* HTML is not allowed in the rich subject and will be escaped automatically
|
||||||
|
* by the clients, but you can use the RichObjectString system provided by
|
||||||
|
* the Nextcloud server to highlight important parameters.
|
||||||
|
* Also make sure, that a plain text subject is always set via
|
||||||
|
* setParsedSubject, to support clients which can not handle rich strings.
|
||||||
|
*
|
||||||
|
* See https://github.com/nextcloud/server/issues/1706 for more information.
|
||||||
|
*
|
||||||
* @param string $subject
|
* @param string $subject
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
* @return $this
|
* @return $this
|
||||||
|
@ -146,6 +167,17 @@ interface IEvent {
|
||||||
public function setMessage(string $message, array $parameters = []): self;
|
public function setMessage(string $message, array $parameters = []): self;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set a parsed message
|
||||||
|
*
|
||||||
|
* HTML is not allowed in the parsed message and will be escaped
|
||||||
|
* automatically by the clients. You can use the RichObjectString system
|
||||||
|
* provided by the Nextcloud server to highlight important parameters via
|
||||||
|
* the setRichMessage method, but make sure, that a plain text message is
|
||||||
|
* always set via setParsedMessage, to support clients which can not handle
|
||||||
|
* rich strings.
|
||||||
|
*
|
||||||
|
* See https://github.com/nextcloud/server/issues/1706 for more information.
|
||||||
|
*
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \InvalidArgumentException if the message is invalid
|
* @throws \InvalidArgumentException if the message is invalid
|
||||||
|
@ -160,6 +192,16 @@ interface IEvent {
|
||||||
public function getParsedMessage(): string;
|
public function getParsedMessage(): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set a RichObjectString message
|
||||||
|
*
|
||||||
|
* HTML is not allowed in the rich message and will be escaped automatically
|
||||||
|
* by the clients, but you can use the RichObjectString system provided by
|
||||||
|
* the Nextcloud server to highlight important parameters.
|
||||||
|
* Also make sure, that a plain text message is always set via
|
||||||
|
* setParsedMessage, to support clients which can not handle rich strings.
|
||||||
|
*
|
||||||
|
* See https://github.com/nextcloud/server/issues/1706 for more information.
|
||||||
|
*
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
* @return $this
|
* @return $this
|
||||||
|
|
|
@ -115,6 +115,17 @@ interface INotification {
|
||||||
public function getSubjectParameters();
|
public function getSubjectParameters();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set a parsed subject
|
||||||
|
*
|
||||||
|
* HTML is not allowed in the parsed subject and will be escaped
|
||||||
|
* automatically by the clients. You can use the RichObjectString system
|
||||||
|
* provided by the Nextcloud server to highlight important parameters via
|
||||||
|
* the setRichSubject method, but make sure, that a plain text message is
|
||||||
|
* always set via setParsedSubject, to support clients which can not handle
|
||||||
|
* rich strings.
|
||||||
|
*
|
||||||
|
* See https://github.com/nextcloud/server/issues/1706 for more information.
|
||||||
|
*
|
||||||
* @param string $subject
|
* @param string $subject
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \InvalidArgumentException if the subject is invalid
|
* @throws \InvalidArgumentException if the subject is invalid
|
||||||
|
@ -129,6 +140,16 @@ interface INotification {
|
||||||
public function getParsedSubject();
|
public function getParsedSubject();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set a RichObjectString subject
|
||||||
|
*
|
||||||
|
* HTML is not allowed in the rich subject and will be escaped automatically
|
||||||
|
* by the clients, but you can use the RichObjectString system provided by
|
||||||
|
* the Nextcloud server to highlight important parameters.
|
||||||
|
* Also make sure, that a plain text subject is always set via
|
||||||
|
* setParsedSubject, to support clients which can not handle rich strings.
|
||||||
|
*
|
||||||
|
* See https://github.com/nextcloud/server/issues/1706 for more information.
|
||||||
|
*
|
||||||
* @param string $subject
|
* @param string $subject
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
* @return $this
|
* @return $this
|
||||||
|
@ -171,6 +192,17 @@ interface INotification {
|
||||||
public function getMessageParameters();
|
public function getMessageParameters();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set a parsed message
|
||||||
|
*
|
||||||
|
* HTML is not allowed in the parsed message and will be escaped
|
||||||
|
* automatically by the clients. You can use the RichObjectString system
|
||||||
|
* provided by the Nextcloud server to highlight important parameters via
|
||||||
|
* the setRichMessage method, but make sure, that a plain text message is
|
||||||
|
* always set via setParsedMessage, to support clients which can not handle
|
||||||
|
* rich strings.
|
||||||
|
*
|
||||||
|
* See https://github.com/nextcloud/server/issues/1706 for more information.
|
||||||
|
*
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @return $this
|
* @return $this
|
||||||
* @throws \InvalidArgumentException if the message is invalid
|
* @throws \InvalidArgumentException if the message is invalid
|
||||||
|
@ -185,6 +217,16 @@ interface INotification {
|
||||||
public function getParsedMessage();
|
public function getParsedMessage();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set a RichObjectString message
|
||||||
|
*
|
||||||
|
* HTML is not allowed in the rich message and will be escaped automatically
|
||||||
|
* by the clients, but you can use the RichObjectString system provided by
|
||||||
|
* the Nextcloud server to highlight important parameters.
|
||||||
|
* Also make sure, that a plain text message is always set via
|
||||||
|
* setParsedMessage, to support clients which can not handle rich strings.
|
||||||
|
*
|
||||||
|
* See https://github.com/nextcloud/server/issues/1706 for more information.
|
||||||
|
*
|
||||||
* @param string $message
|
* @param string $message
|
||||||
* @param array $parameters
|
* @param array $parameters
|
||||||
* @return $this
|
* @return $this
|
||||||
|
|
Loading…
Reference in a new issue