Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter out unsupported regex hostnames in cosmetic filters #980

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

antonok-edm
Copy link
Collaborator

Should resolve the following error for now:

Not publishing a new version of Brave Ad Block Updater due to failure downloading a source: uBlock Origin 2024 Filters could not be converted to iOS content blocking syntax. Reason: Error while parsing [a-z][a-z+.-]*:\/\//^dizipal\\d+\\\.com\$/[:/]: Start of line assertion can only appear as the first term in a filter.
Content Rule List compiling failed: Compiling failed.
Invalid or unsupported regular expression.

I'll investigate the root cause later and make sure adblock-rust is prepared to handle these properly.

@antonok-edm antonok-edm self-assigned this Sep 21, 2024
@antonok-edm antonok-edm force-pushed the unsupported-cosmetic-regex-hostname branch from a5a5b92 to 3191d46 Compare September 21, 2024 17:24
@antonok-edm antonok-edm merged commit 6375af0 into master Sep 21, 2024
8 checks passed
@antonok-edm antonok-edm deleted the unsupported-cosmetic-regex-hostname branch September 21, 2024 17:30
// Brave throws an error from the generic filter injection script if any CSS is invalid.
// https://github.com/uBlockOrigin/uAssets/commit/6eaa9dd46371478d76371426cb99f75d99c7402d
if (line.startsWith('##') >= 0 && line.indexOf('head\\"') >= 0) {
if (line.startsWith('/^dizipal\\d+\\.com$/##')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex makes me nervous, do we have unit tests for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a string, not a regex 😛

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah the filter rule has a regex

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

Successfully merging this pull request may close these issues.

2 participants