Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Regex matches any URL containing "github" in its path #153

Closed
sangster opened this issue May 5, 2020 · 10 comments
Closed

Regex matches any URL containing "github" in its path #153

sangster opened this issue May 5, 2020 · 10 comments

Comments

@sangster
Copy link

sangster commented May 5, 2020

Describe the bug

The regular expression used to match pages is too permissive. It will match any URL containing github, even if it's just in the path part of the URL.

Examples:

Affected Regexp:

^https?://(?!www.google.com)(((?!desktop).*.)?(githubusercontent|githubstatus|github).(?!io|myshopify|blog)).*

Expected behavior

I expect this theme to only apply on github.com (and perhaps related domains?).

Screenshot

screen

@sangster
Copy link
Author

sangster commented May 5, 2020

I noticed in #136 that you posted a link to this regex test page: https://regex101.com/r/bW6cYw/3

I imagine this regex is from a previous version, as it's not the regex used in the current version. See this page, which includes the example URLs from above: https://regex101.com/r/sEZPE5/2

@Snazzie
Copy link
Member

Snazzie commented May 5, 2020

This was actually fixed in #152 :)
https://regex101.com/r/sEZPE5/3

@Snazzie
Copy link
Member

Snazzie commented May 5, 2020

Make sure you havent edited the style (which prevents it from auto updating).

Currently, the latest version is 1.27.0

@Snazzie Snazzie pinned this issue May 5, 2020
@Snazzie
Copy link
Member

Snazzie commented May 5, 2020

^https?:\/\/(?!www\.google\.com)(((?!desktop).*\.)?(githubusercontent|githubstatus|github)\.(?!io|myshopify|blog)).*

Just had another look at the difference between your regex and regex in master. it contains part of newer work which introduces githubstatus. but doesnt contain the fix that was mentioned above.
Im curious to how you manage to get this and if its actually in your style file?

@sangster
Copy link
Author

sangster commented May 5, 2020

I installed it from this page: https://userstyles.org/styles/168350/githubdarktheme

Strangely, I still get this problem if I delete the style outright, and re-add it (from the above link). Perhaps there's something wrong with my Firefox profile.

@sangster
Copy link
Author

sangster commented May 5, 2020

Here's the regex, verbatim:

^https?://(?!www.google.com)(((?!desktop).*.)?(githubusercontent|githubstatus|github).(?!io|myshopify|blog)).*

@Snazzie
Copy link
Member

Snazzie commented May 5, 2020

Try removing the style and installing via https://github.com/DarkThemeHub/GithubDarkTheme#step-2

Userstyles hasnt been reliable with updating the style file

@sangster
Copy link
Author

sangster commented May 5, 2020

Boom. That did it.

Thanks bunches for your time. Sorry for not reading the README. It never even crossed my mind that userstyles.org could be the issue.

cheers!

@sangster sangster closed this as completed May 5, 2020
@Snazzie
Copy link
Member

Snazzie commented May 5, 2020

No problem! If you've come across any other bugs, dont hesitate to submit an issue :)

@Snazzie
Copy link
Member

Snazzie commented May 5, 2020

I just did a sanity check on the style in userstyles site. it has the correct regex. what the heck...

I noticed the style file when installed is different to what i put in. I guess they process it and the regex processor is whack...

I would take this theme off there, but its my only source of users. 😞

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants