# Proxy avatar urls broken in quotes with sub folder install

**URL:** https://meta.discourse.org/t/proxy-avatar-urls-broken-in-quotes-with-sub-folder-install/64821
**Category:** Bug
**Tags:** subfolder
**Created:** [20.Июнь.2017 17:58:01 UTC](https://meta.discourse.org/t/proxy-avatar-urls-broken-in-quotes-with-sub-folder-install/64821 "2017-06-20T17:58:01Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [20.Июнь.2017 17:58:01 UTC](https://meta.discourse.org/t/proxy-avatar-urls-broken-in-quotes-with-sub-folder-install/64821/1 "2017-06-20T17:58:01Z")

</div>

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`)

> <https://github.com/discourse/discourse/blob/main/app/controllers/user_avatars_controller.rb#L124>

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [20.Июнь.2017 23:25:05 UTC](https://meta.discourse.org/t/proxy-avatar-urls-broken-in-quotes-with-sub-folder-install/64821/2 "2017-06-20T23:25:05Z")

</div>

What do you think @neil?

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [21.Июнь.2017 15:04:24 UTC](https://meta.discourse.org/t/proxy-avatar-urls-broken-in-quotes-with-sub-folder-install/64821/3 "2017-06-21T15:04:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [23.Июнь.2017 20:11:44 UTC](https://meta.discourse.org/t/proxy-avatar-urls-broken-in-quotes-with-sub-folder-install/64821/4 "2017-06-23T20:11:44Z")

</div>

Hmm no, it seems to be this:

> <https://github.com/discourse/discourse/blob/main/lib/pretty_text/shims.js#L45-L47>

which is used in [here](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/engines/discourse-markdown/quote.js.es6#L48) and [here](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/engines/markdown-it/quotes.js.es6).

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

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [27.Июнь.2017 19:59:50 UTC](https://meta.discourse.org/t/proxy-avatar-urls-broken-in-quotes-with-sub-folder-install/64821/5 "2017-06-27T19:59:50Z")

</div>

> [@neil](#):
>
> Give it a try please.

It works!

Note to others: You’ll need to [rebake](https://meta.discourse.org/t/rebake-all-posts-matching-a-pattern/48713) 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.)

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [27.Июнь.2017 20:18:27 UTC](https://meta.discourse.org/t/proxy-avatar-urls-broken-in-quotes-with-sub-folder-install/64821/6 "2017-06-27T20:18:27Z")

</div>


