mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-02-16 15:19:55 +03:00
[XenForoBridge] Fix error if message is < 70 chars (#2707)
At the time of writing, this occurs on the following thread: https://forum.xda-developers.com/t/optimized-lineageos19-1-v4-0-23apr.4426575/ Fixes the following error: ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) in ./rss-bridge/bridges/XenForoBridge.php:272 Stack trace: 0 ./rss-bridge/bridges/XenForoBridge.php(272): strpos() 1 ./rss-bridge/bridges/XenForoBridge.php(146): XenForoBridge->extractThreadPostsV2() 2 ./rss-bridge/actions/DisplayAction.php(134): XenForoBridge->collectData() 3 ./rss-bridge/index.php(24): DisplayAction->execute() 4 {main}
This commit is contained in:
parent
d107592094
commit
36d11fd06e
1 changed files with 1 additions and 1 deletions
|
@ -269,7 +269,7 @@ class XenForoBridge extends BridgeAbstract {
|
|||
$item['uri'] = $url . '#' . $post->getAttribute('id');
|
||||
|
||||
$title = $post->find('div[class~="message-content"] article', 0)->plaintext;
|
||||
$end = strpos($title, ' ', 70);
|
||||
$end = strpos($title, ' ', min(70, strlen($title)));
|
||||
$item['title'] = substr($title, 0, $end);
|
||||
|
||||
if ($post->find('time[datetime]', 0)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue