[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
This commit is contained in:
logmanoriginal 2018-09-08 16:53:21 +02:00
parent 44764f7182
commit 37f84196b7
1 changed files with 3 additions and 1 deletions

View File

@ -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)) {