diff --git a/lib/social/service.php b/lib/social/service.php index 269c6732..2e521d4a 100644 --- a/lib/social/service.php +++ b/lib/social/service.php @@ -169,8 +169,15 @@ public function format_content($post, $format) { $format = apply_filters(Social::$prefix . 'broadcast_format', $format); $format = apply_filters(Social::$prefix . $this->service . '_broadcast_format', $format); + + $_format = $format; + $available = $this->max_broadcast_length(); + foreach (Social::broadcast_tokens() as $token => $description) { + $_format = str_replace($token, '', $_format); + } + $available = $available - strlen($_format); + $_format = explode(' ', $format); - $available = $this->max_broadcast_length() - count($format); foreach (Social::broadcast_tokens() as $token => $description) { $content = ''; switch ($token) {