6
57
Fork
You've already forked smolfedi
5

Feed cuts before post from snac/2.86 #2

Closed
opened 2026年04月10日 18:32:32 +02:00 by nykula · 5 comments

Hi, there has just appeared a post that I see in my Mastodon feed: https://buc.ci/abucci/p/1775837743.319888 - but my https://smolfedi.pollux.casa/index.php?a=0 feed cuts right before it, not getting to pagination, other posts and footer. Looks like some PHP function is throwing at that point, but I don't see the error message so I don't know more details to report.

Hi, there has just appeared a post that I see in my Mastodon feed: https://buc.ci/abucci/p/1775837743.319888 - but my https://smolfedi.pollux.casa/index.php?a=0 feed cuts right before it, not getting to pagination, other posts and footer. Looks like some PHP function is throwing at that point, but I don't see the error message so I don't know more details to report.
Owner
Copy link

Hi
Is it a pinned post ?

Hi Is it a pinned post ?
Author
Copy link

Doesn't seem to be pinned. I set up an instance and here's the error trace:

PHP Fatal error: Uncaught TypeError: basename(): Argument #1 ($path) must be of type string, null given in /var/www/smolfedi/lib/html.php:348
Stack trace:
#0 /var/www/smolfedi/lib/html.php(348): basename()
#1 [internal function]: {closure:rewrite_hashtags():343}()
#2 /var/www/smolfedi/lib/html.php(341): preg_replace_callback()
#3 /var/www/smolfedi/lib/html.php(112): rewrite_hashtags()
#4 /var/www/smolfedi/index.php(36): html_post()
#5 {main}
 thrown in /var/www/smolfedi/lib/html.php on line 348

Debugging rewrite_hashtags:

> var_dump($hm[1]);
string(21) "https://buc.ci?t=tech"
> var_dump(parse_url(html_entity_decode($hm[1])));
array(3) {
 ["scheme"]=>
 string(5) "https"
 ["host"]=>
 string(6) "buc.ci"
 ["query"]=>
 string(6) "t=tech"
}

Looks like the URL has a query string but no path, while the code around there expects a path.

Doesn't seem to be pinned. I set up an instance and here's the error trace: ``` PHP Fatal error: Uncaught TypeError: basename(): Argument #1 ($path) must be of type string, null given in /var/www/smolfedi/lib/html.php:348 Stack trace: #0 /var/www/smolfedi/lib/html.php(348): basename() #1 [internal function]: {closure:rewrite_hashtags():343}() #2 /var/www/smolfedi/lib/html.php(341): preg_replace_callback() #3 /var/www/smolfedi/lib/html.php(112): rewrite_hashtags() #4 /var/www/smolfedi/index.php(36): html_post() #5 {main} thrown in /var/www/smolfedi/lib/html.php on line 348 ``` Debugging `rewrite_hashtags`: ``` > var_dump($hm[1]); string(21) "https://buc.ci?t=tech" > var_dump(parse_url(html_entity_decode($hm[1]))); array(3) { ["scheme"]=> string(5) "https" ["host"]=> string(6) "buc.ci" ["query"]=> string(6) "t=tech" } ``` Looks like the URL has a query string but no path, while the code around there expects a path.
Owner
Copy link

This commit should correct the problem.

80a570ba88

This commit should correct the problem. https://codeberg.org/adele/smolfedi/commit/80a570ba88ea55058b87875b15c3a7766297fd3a
Owner
Copy link

Another commit to complete correction

5447028d42

Another commit to complete correction https://codeberg.org/adele/smolfedi/commit/5447028d423bcd17029958d3b79f8ecaa2d53701
Author
Copy link

Thank you! I confirm that after the second commit the hashtags from snac match the expected behavior.

Thank you! I confirm that after the second commit the hashtags from snac match the expected behavior.
Sign in to join this conversation.
No Branch/Tag specified
main
v1.2.8
v1.2.7
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.0
v1.0.11
v1.0.10
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
adele/smolfedi#2
Reference in a new issue
adele/smolfedi
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?