From 37f84196b7952d2a4c3de45b4da54b0224fe4d4f Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 8 Sep 2018 16:53:21 +0200 Subject: [PATCH] [GooglePlusPostBridge] Fix title is empty if content is too short The bridge would generate empty titles if the content is longer than 50 characters, but doesn't have further spaces in it. With this commit the title is correctly generated based on the contents, taking missing spaces into account. References #786 --- bridges/GooglePlusPostBridge.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bridges/GooglePlusPostBridge.php b/bridges/GooglePlusPostBridge.php index 713a4320..48949b23 100644 --- a/bridges/GooglePlusPostBridge.php +++ b/bridges/GooglePlusPostBridge.php @@ -74,7 +74,9 @@ class GooglePlusPostBridge extends BridgeAbstract{ // Make title at least 50 characters long, but don't add '...' if it is shorter! if(strlen($message->plaintext) > 50) { - $end = strpos($message->plaintext, ' ', 50); + $end = strpos($message->plaintext, ' ', 50) ?: strlen($message->plaintext); + } else { + $end = strlen($message->plaintext); } if(strlen(substr($message->plaintext, 0, $end)) === strlen($message->plaintext)) {