aboutsummaryrefslogtreecommitdiffstats
path: root/mod/message.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-11 23:13:36 -0800
committerfriendica <info@friendica.com>2013-12-11 23:13:36 -0800
commitb3fe221b7fe9c6ecc151d9c00f36d3913526f6a3 (patch)
tree2f074601c98f8403ba5b6db2a4b76b552ddfa8aa /mod/message.php
parent18f0ab2605790f616ffd9b7a988e8dbdb10a0157 (diff)
downloadvolse-hubzilla-b3fe221b7fe9c6ecc151d9c00f36d3913526f6a3.tar.gz
volse-hubzilla-b3fe221b7fe9c6ecc151d9c00f36d3913526f6a3.tar.bz2
volse-hubzilla-b3fe221b7fe9c6ecc151d9c00f36d3913526f6a3.zip
issue #240 - we were using htmlentities instead of htmlspecialchars in several places, and this was a bit greedy in the set of characters which were converted from utf-8 to HTML entities. Also brought mail attachments up to date so they are rendered identically to item attachments.
Diffstat (limited to 'mod/message.php')
-rw-r--r--mod/message.php34
1 files changed, 1 insertions, 33 deletions
diff --git a/mod/message.php b/mod/message.php
index a0382f63d..bee3b68f3 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -425,39 +425,7 @@ function message_content(&$a) {
foreach($messages as $message) {
- $s = $arr = '';
-
- if($message['attach'])
- $arr = json_decode_plus($message['attach']);
- if($arr) {
- $s .= '<div class="body-attach">';
- foreach($arr as $r) {
- $matches = false;
- $icon = '';
- $icontype = substr($r['type'],0,strpos($r['type'],'/'));
-
- switch($icontype) {
- case 'video':
- case 'audio':
- case 'image':
- case 'text':
- $icon = '<div class="attachtype icon s22 type-' . $icontype . '"></div>';
- break;
- default:
- $icon = '<div class="attachtype icon s22 type-unkn"></div>';
- break;
- }
-
- $title = htmlentities($r['title'], ENT_COMPAT,'UTF-8');
- if(! $title)
- $title = t('unknown.???');
- $title .= ' ' . $r['length'] . ' ' . t('bytes');
-
- $url = $a->get_baseurl() . '/magic?f=&hash=' . $message['from_xchan'] . '&dest=' . $r['href'] . '/' . $r['revision'];
- $s .= '<a href="' . $url . '" title="' . $title . '" class="attachlink" >' . $icon . '</a>';
- }
- $s .= '<div class="clear"></div></div>';
- }
+ $s = theme_attachments($message);
$mails[] = array(
'id' => $message['id'],