summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--controllers/hooks.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/controllers/hooks.php b/controllers/hooks.php
index b597c7b..8a54ed8 100644
--- a/controllers/hooks.php
+++ b/controllers/hooks.php
@@ -25,16 +25,16 @@ $app->post('/mailgun', function() use($app) {
);
if(k($params, 'Subject'))
- $data['name'] = k($params, 'Subject');
+ $data['name'] = trim(k($params, 'Subject'));
- if(k($params['body-plain'])
- $data['content'] = k($params, 'body-plain');
+ if(k($params, 'body-plain'))
+ $data['content'] = trim(k($params, 'body-plain'));
// Set tags for any hashtags used in the body
if(preg_match_all('/#([^ ]+)/', $data['content'], $matches)) {
$tags = array();
foreach($matches[1] as $m)
- $tags[] = $m;
+ $tags[] = trim($m);
if($tags) {
if($user->send_category_as_array != 1) {
$data['category'] = $tags;