From ea4a20015c13a4b6a00be93158e96cdbde721d71 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 25 Jul 2015 13:49:21 +0000 Subject: fix posting by email --- controllers/hooks.php | 8 ++++---- 1 file 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; -- cgit v1.2.3