mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-26 11:26:31 +03:00
[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:
parent
44764f7182
commit
37f84196b7
1 changed files with 3 additions and 1 deletions
|
@ -74,7 +74,9 @@ class GooglePlusPostBridge extends BridgeAbstract{
|
||||||
|
|
||||||
// Make title at least 50 characters long, but don't add '...' if it is shorter!
|
// Make title at least 50 characters long, but don't add '...' if it is shorter!
|
||||||
if(strlen($message->plaintext) > 50) {
|
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)) {
|
if(strlen(substr($message->plaintext, 0, $end)) === strlen($message->plaintext)) {
|
||||||
|
|
Loading…
Reference in a new issue