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.
Feed cuts before post from snac/2.86 #2
Closed
opened 2026年04月10日 18:32:32 +02:00 by nykula
·
5 comments
nykula
commented 2026年04月10日 18:32:32 +02:00
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.
adele
commented 2026年04月11日 18:15:48 +02:00
Hi
Is it a pinned post ?
Hi
Is it a pinned post ?
nykula
commented 2026年04月11日 23:02:10 +02:00
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.
adele
commented 2026年04月12日 10:58:57 +02:00
This commit should correct the problem.
This commit should correct the problem.
https://codeberg.org/adele/smolfedi/commit/80a570ba88ea55058b87875b15c3a7766297fd3a
adele
commented 2026年04月12日 11:31:29 +02:00
Another commit to complete correction
Another commit to complete correction
https://codeberg.org/adele/smolfedi/commit/5447028d423bcd17029958d3b79f8ecaa2d53701
nykula
commented 2026年04月12日 17:17:24 +02:00
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.
nykula
closed this issue 2026年04月12日 17:17:25 +02:00
Sign in to join this conversation.
No Branch/Tag specified
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
Loading...
Add table
Add a link
Reference in a new issue
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?