diff options
author | Aaron Parecki <aaron@parecki.com> | 2015-07-25 13:49:21 +0000 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2015-07-25 13:49:21 +0000 |
commit | ea4a20015c13a4b6a00be93158e96cdbde721d71 (patch) | |
tree | 7922dbde31f9698bde119c1bed0daf036a801f8f /controllers/hooks.php | |
parent | c3fb722ad4bade9c4027c04de9b8dee511ab5756 (diff) |
fix posting by email
Diffstat (limited to 'controllers/hooks.php')
-rw-r--r-- | controllers/hooks.php | 8 |
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; |