Conversation
Search uses tokens for authentication so check to see if we have a current token in addition to a logged in user. Cleanup the parameter passing to $this->get_posts() as well as otherwise some values can be set to null which break wp_getposts() in some circumstances.
To be honest, it's been a while since I touched this part of the code but when the user has a token they should be logged in, no? |
I think so now, but when I wrote this I was still getting used to the codebase and this was the solution I came up with. Let me double check it and swap over to the logged in user call if it works. |
|
Ok, I double checked it and no, during a token auth session the wp user is not set: enable-mastodon-apps/includes/class-mastodon-api.php Lines 777 to 787 in fafa413 I think it should be though, so I'll change the PR to add that code just above the was_used() call like it is in the logged in session. |
|
In fact, looking a little deeper, |
85fc98b to
e3ac042
Compare
And remove the toke permission as it is no longer used.
e3ac042 to
bb08445
Compare
Search uses tokens for authentication so check to see if we have a current token in addition to a logged in user.
Cleanup the parameter passing to $this->get_posts() as well as otherwise some values can be set to null which break wp_getposts() in some circumstances.