filter rules - bug ?

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
nexaen
Posts: 16
Joined: Mon Aug 27, 2007 6:17 pm

filter rules - bug ?

Post by nexaen »

hello
today I downloaded ABP and used it , works well ; but there is something wrong with filter rules I think ;
one of the filters I used is /ad/ , I added this filter to block all ads in the ad directory , but ABP reads it as ad/ , and blocks all URLs with these characters like
- wrote:www.aaa/downlo[b]ad/[/b]bbb.jpg
, before I used ADBlocker and the same behavior happend ;

does it look like a bug ? or there is something wrong with me ?

thanks for your attentions
nexaen
MonztA
ABP Developer
Posts: 3957
Joined: Mon Aug 14, 2006 12:18 am
Location: Germany

Post by MonztA »

There needs to be at least one * in your filter (like */ad/). Otherwise it will be handled as a Regular Expression.
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

You cannot use a rule that begins and also ends with a "/" without using */wildcards/* around it. All other filter rules do not need wildcards.
nexaen
Posts: 16
Joined: Mon Aug 27, 2007 6:17 pm

Post by nexaen »

@ MonztA :
thanks for your help ;

but whats the difference between ad/ and /ad/in the filters ?

currently Im using Agnitum Outpost Firewall and it has a plugin called "ADS" , it has a keyword ad blocker and I exported all the filter there to the ABP , so if want to change the filters according to what you said , it takes times to do duo to the large size of it ( around 30 kb ) ,

what forces developers to make a such filter-rules for this situation ?

is it a forgotten programming problem ?

@ rick752 :
thanks for your help ;

can this rule change ?
why I cant ?
why ABP cant recognize it ?
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

/ad/ is interpreted as a regular expression rule and actually only blocks addresses containing "ad" (the slashes are not interpreted as slashes, but rather what type of rule it is).

For that to be interpreted as a simple filter rule it needs to be */ads/* to block the actual address of /ads/.

ads/ will block anything containing ads/ because it is not enclosed with slashes. A slash on one end is ok ... but you need outside wildcards if you use one on BOTH ends to define it as a 'simple' filter ... otherwise it gets interpreted as a 'regular' expression which is actually code language.
nexaen
Posts: 16
Joined: Mon Aug 27, 2007 6:17 pm

Post by nexaen »

rick752 wrote:/ad/ is interpreted as a regular expression rule and actually only blocks addresses containing "ad" (the slashes are not interpreted as slashes, .
so you dear mean there is no dirfference between /ad/ and ad , I can add them and they both behave the same ;

its strange , and waste of character ;
rick752 wrote:but rather what type of rule it is)
why slashes are needed to define a expression ? , why exact the word that adds in the list wont be defined as a expression itself ?

Where can I read the rules ?

thanks
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

Try these:
http://adblockplus.org/en/faq_basics#regexps
http://adblockplus.org/en/filters

All filters will work EXACTLY how you write them .... EXCEPT for the ones that start and end with "/slashes/". For those to work correctly, you must enclose them with wildcards like */slashes/* ... then it is ok and will block /slashes/.

If you do NOT surround them with wildcards, it will be interpreted as slashes.
User avatar
Stupid Head
Posts: 214
Joined: Sat Aug 26, 2006 8:11 pm
Location: USA

Post by Stupid Head »

If you enclose a filter in slashes, then it will be interpreted as a "regular expression." Used by programmers and advanced users, a regular expression is a string with a special syntax that allows a fine-grained way to match a set of strings. They can be as simple (/\.gif$/) or more complicated (/://ad[bcf-np-z]?\d{0,2}\./).

You probably shouldn't worry yourself about this because regular expressions aren't the preferred method for Adblock Plus. Just remember to always add a wildcard (*) if your filter begins and ends with a slash (/). If you want to learn more about regular expressions, Wikipedia has an overview. Also, there is a page for the specific syntax used by Adblock Plus (and Mozilla).
What, me worry?
nexaen
Posts: 16
Joined: Mon Aug 27, 2007 6:17 pm

Post by nexaen »

thank you guys ;

I edited my filters list ;
,
Download:

Code: Select all

http://www.speedyshare.com/883160405.html
a cool list of filters that blocks most of the ads ;
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

@nexaen:

Do take this wrong as I am not to try to bust your butt or anything ... but your filters are a total disaster! I looked at them and the first thing that I noticed is that you haven't figured out that the shortest filter string will block anything that is longer with the same info in it. This is basic 'wildcard understood' rules in Adblock. I saw this redundancy in many, MANY filter strings in that list. Here's the first (of many) examples. You have these:

Code: Select all

/pagead2.
http://pagead2.googlesyndication.com
http://pagead2.googlesyndication.com/pagead
http://pagead2.googlesyndication.com/pagead/
http://pagead2.googlesyndication.com/pagead/google_adsense_script.js
http://pagead2.googlesyndication.com/pagead/iclk?sa=
http://pagead2.googlesyndication.com/pagead/show_ads.js
Only "/pagead2." would be necessary, the others are totally worthless. I noticed that you have done things like this with MOST of your strings. I'm not exactly sure how you even made that filter (you did, didn't you? I actually notice quite a few 'groups of strings' that look very familiar in there) the first string should have shown you that the others were already blocked. Either you copied a bunch of filters from a bunch of different sources and just 'blended them alphabetically ... or you just didn't do a very good job reading how to make filter strings.

You are also going to have very big problems on some major video sites, too. Those will be revealed to you eventually after a little surfing.

I'm not sure whether you wanted us to TEST your filters or to USE your filters with your last line???? I hope that you do realize that the 2 others (and also myself) that posted replies to you here are not only users but are also all filter maintainers? We pretty much stick to own own filters for use because they have been tested and tweaked for years. We also do not blend all of our filters with each other's subscriptions unless they are specifically meant to be used with each other. This is a disaster waiting to happen to anyone else who tries this too. Only the author knows why things are the way they are in their own subscription. :wink:
nexaen
Posts: 16
Joined: Mon Aug 27, 2007 6:17 pm

Post by nexaen »

@ rick752 ;
oh yes , you are right ;
as I said before , the firewall im using has a ad blocker , but its engine isnt as powerfull as this one ; so I have to add a filter in some ways , (and sometimes for a complete URL, I have to add it with http:// ,http://www. , www. and without http://www. :shock: :lol: ) , almost most of the filters are preset by the firewall , and because the firewall blocks all the ads in the incoming datas , so I did it according to the firewall rules ; and it applies to my browsers ,
and it causes that I forgot to attend to ;
seems I have to edit it more and more to be a good one for use in firefox ;
thanks for your testing and your helps and all other who helped me in this topic ,
Im not waiting for someone's share , whenever I've found an unblocked ad , I will add its sign to my database ; most of the times it isnt too hard to do ;

sorry for my bad english ;


----

off-topic :
do you know a good ad-blocker like adblock or ABP [in firefox] , that blocks all incoming ads ? ( applies to all my browers not only FF )
Locked