tersiswilvin / Roblox-Legacy-Old-Theme

Repository for the Roblox Legacy Old Theme.
https://userstyles.world/style/5399/
12 stars 1 forks source link

Error in regex causes avatar thumbnail to break #43

Closed jamesa08 closed 10 months ago

jamesa08 commented 10 months ago

Are you up-to-date?

Is the problem in Experimental?

Browser

Google Chrome

Page URL

https://www.roblox.com/home

Channel

Experimental

Type

JavaScript

Describe the Problem

Error in the regex selection, causing the avatar thumbnail to break

line 2486

if (window.devicePixelRatio > 1) {
  avatarThumb.setAttribute("src", avatarThumb.getAttribute("src").replace(/150/g, "720"))
} else {
  avatarThumb.setAttribute("src", avatarThumb.getAttribute("src").replace(/720/g, "150"))
}

example URL: https://tr.rbxcdn.com/30DAY-AvatarHeadshot-3A27B04FA26C03150D0F12D3DE3CE9DF-Png/150/150/AvatarHeadshot/Png/noFilter Currently, it matches everything with 150/720, which will break the avatar hash earlier in the URL

image

This can be fixed by matching with a leading/trailing slash (/150\//g) and subsequently replacing it in the replace text.

tersiswilvin commented 10 months ago

Hi, thank you for reporting this issue. I'll get around to fixing this later today when I have time.

tersiswilvin commented 10 months ago

Fixed in a6b5631