Proxy avatar urls broken in quotes with sub folder install

AI-generated summary

A bug was reported regarding broken proxy avatar URLs in quotes on a subfolder Discourse install pfaffman. The issue was traced to incorrect URL handling in the code, with initial suspicion on Rails.root usage pfaffman. neil identified the root cause in the pretty_text shims and pushed a fix neil. The fix was confirmed working by pfaffman, who also noted that existing posts require rebaking using rake posts:rebake_match to update avatars.

On a subfolder install site I noticed that the avatar letters were broken in quotes.

I don’t really know, but I think that Rails.root in line 124 needs to be replaced with Discourse.getURL (which makes me wonder about the other 71 files that refer to Rails.root)

3개의 좋아요

What do you think @neil?

Yeah that’s probably the reason why. Added this to my list.

1개의 좋아요

Hmm no, it seems to be this:

which is used in here and here.

I pushed a fix. @pfaffman Give it a try please.

3개의 좋아요

It works!

Note to others: You’ll need to rebake after you do this upgrade to fix the avatars in existing posts. (I can’t find simple instructions for doing a simple rebake; doing rake posts:rebake_match["quote"] is probably better anyway rake posts:rebake_match["[quote"] might be better still, but it looks funny.)

3개의 좋아요