summaryrefslogtreecommitdiff
path: root/app/Core
diff options
context:
space:
mode:
Diffstat (limited to 'app/Core')
-rw-r--r--app/Core/Helper.php19
-rw-r--r--app/Core/HttpClient.php3
2 files changed, 20 insertions, 2 deletions
diff --git a/app/Core/Helper.php b/app/Core/Helper.php
index 34a5e6ab..29003416 100644
--- a/app/Core/Helper.php
+++ b/app/Core/Helper.php
@@ -502,7 +502,7 @@ class Helper
public function markdown($text, array $link = array())
{
$parser = new Markdown($link, $this);
- $parser->setMarkupEscaped(true);
+ $parser->setMarkupEscaped(MARKDOWN_ESCAPE_HTML);
return $parser->text($text);
}
@@ -770,4 +770,21 @@ class Helper
return 'fa-file-o';
}
+
+ /**
+ * Display gravatar image
+ *
+ * @access public
+ * @param string $email
+ * @param string $alt
+ * @return string
+ */
+ public function avatar($email, $alt = '')
+ {
+ if (! empty($email) && $this->config->get('integration_gravatar') == 1) {
+ return '<img class="avatar" src="https://www.gravatar.com/avatar/'.md5(strtolower($email)).'?s=25" alt="'.$this->e($alt).'" title="'.$this->e($alt).'">';
+ }
+
+ return '';
+ }
}
diff --git a/app/Core/HttpClient.php b/app/Core/HttpClient.php
index 96860152..e1d90858 100644
--- a/app/Core/HttpClient.php
+++ b/app/Core/HttpClient.php
@@ -47,8 +47,9 @@ class HttpClient
}
$headers = array(
- 'Connection: close',
'User-Agent: '.self::HTTP_USER_AGENT,
+ 'Content-Type: application/json',
+ 'Connection: close',
);
$context = stream_context_create(array(