From 988672276941ebe4687018c5b0e694233c4b4068 Mon Sep 17 00:00:00 2001 From: oes Date: Wed, 11 Sep 2002 16:04:20 +0000 Subject: [PATCH] Preserve original quoting style in tags wherever possible. Fixes Bug #605956 --- default.filter | 63 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/default.filter b/default.filter index aca47836..d9fcb382 100644 --- a/default.filter +++ b/default.filter @@ -1,8 +1,8 @@ # ******************************************************************** # -# File : $Source: /cvsroot/ijbswa//current/default.filter,v $ +# File : $Source: /cvsroot/ijbswa/current/default.filter,v $ # -# $Id: default.filter,v 1.11.2.6 2002/08/23 14:12:26 oes Exp $ +# $Id: default.filter,v 1.12 2002/09/05 14:55:38 oes Exp $ # # Purpose : Rules to process the content of web pages # @@ -205,10 +205,10 @@ FILTER: img-reorder Reorder attributes in tags to make the banners-by-* fi # This makes banners-by-size more effective and allows both banners-by-size # and banners-by-link to preserve the original image URL in the alt attribute. -s|]*)src\s*=\s*(['"])([^>\\\2]+)\2(.*)>||siUg -s|]*)src\s*=\s*([^'">\\\s]+?)([^\\>]*)>||siUg +s|]*)src\s*=\s*(['"])([^>\\\2]+)\2|]*)src\s*=\s*([^'">\\\s]+)|]*)width\s*=\s*?(["']?)(\d+?)\3(.*)>||siUg +s|\\\\2]+\2\|[^'">\\\s]+?))([^>]*)width\s*=\s*(["']?)(\d+?)|]*)width\s*=\s*?(["']?)(\d+?)\3(.*)>|]*(width=(['"]?)88\3)[^>]*(height=(['"]?)31\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)88\4)[^>]*?(height=(['"]?)31\6)[^>]*>@$1Killed-$2-by-size$1@sig # 120*60, 120*90, 120*240, 120*600 -s@]*(width=(['"]?)120\3)[^>]*(height=(['"]?)(?:600?|90|240)\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)120\4)[^>]*?(height=(['"]?)(?:600?|90|240)\6)[^>]*>@$1Killed-$2-by-size$1@sig # 125*125 -s@]*(width=(['"]?)125\3)[^>]*(height=(['"]?)125\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)125\4)[^>]*?(height=(['"]?)125\6)[^>]*>@$1Killed-$2-by-size$1@sig # 160*600 -s@]*(width=(['"]?)160\3)[^>]*(height=(['"]?)600\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)160\4)[^>]*?(height=(['"]?)600\6)[^>]*>@$1Killed-$2-by-size$1@sig # 180*150 -s@]*(width=(['"]?)180\3)[^>]*(height=(['"]?)150\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)180\4)[^>]*?(height=(['"]?)150\6)[^>]*>@$1Killed-$2-by-size$1@sig # 234*60, 468*60 (Most Banners!) -s@]*(width=(['"]?)(?:234|468)\3)[^>]*(height=(['"]?)60\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)(?:234|468)\4)[^>]*?(height=(['"]?)60\6)[^>]*>@$1Killed-$2-by-size$1@sig # 240*400 -s@]*(width=(['"]?)240\3)[^>]*(height=(['"]?)400\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)240\4)[^>]*?(height=(['"]?)400\6)[^>]*>@$1Killed-$2-by-size$1@sig # 250*250, 300*250 -s@]*(width=(['"]?)(?:250|300)\3)[^>]*(height=(['"]?)250\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)(?:250|300)\4)[^>]*?(height=(['"]?)250\6)[^>]*>@$1Killed-$2-by-size$1@sig # 336*280 -s@]*(width=(['"]?)336\3)[^>]*(height=(['"]?)280\5)[^>]*>@Killed-$1-by-size@sigU +s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)336\4)[^>]*?(height=(['"]?)280\6)[^>]*>@$1Killed-$2-by-size$1@sig # Note: 200*50 was also proposed, but it probably causes too much collateral damage: # -#s@]*(width=(['"]?)200\3)[^>]*(height=(['"]?)50\5)[^>]*>@Killed-$1-by-size@sigU +#s@\\\1\s]+)\1)?[^>]*?(width=(['"]?)200\4)[^>]*?(height=(['"]?)50\6)[^>]*>@$1Killed-$2-by-size$1@sig ################################################################################# @@ -259,18 +261,18 @@ FILTER: banners-by-link Kill banners by their links to known clicktrackers # Common case with width and height attributes: # -s@\1]*(?:\ +s@\1\s]*?(?:\ adclick # See www.dn.se \ | atwola\.com/(?:link|redir) # see www.cnn.com \ | /jump/ # redirs for doublecklick.net ads \ | tracker | counter # common \ | adlog\.pl # see sf.net \ -)[^>\1]*)\1[^>]*>\s*]*((?:width|height)\s*=\s*(['"]?)\d+?\5)[^>]*((?:width|height)\s*=\s*(['"]?)\d+?\7)[^>]*>\ -@Killed $3 by hwlink to $2@siUgx +)[^>\1\s]*)\1[^>]*>\s*\\\3\s]+)\3)?[^>]*((?:width|height)\s*=\s*(['"]?)\d+?\6)[^>]*((?:width|height)\s*=\s*(['"]?)\d+?\8)[^>]*>\ +@$1Killed@sigx # Rare case w/o explicit dimensions: # -s@\1]*(?:adclick|atwola\.com/(?:link|redir)|doubleclick\.net/jump)[^>\1]*)\1[^>]*>\s*]*>@Killed $3 by link to $2@siUg +s@\1\s]*?(?:adclick|atwola\.com/(?:link|redir)|doubleclick\.net/jump/|tracker|counter|adlog\.pl)[^>\1\s]*)\1[^>]*>\s*\\\3\s]+)\3)?[^>]*>@$1Killed@sig ################################################################################# # @@ -358,6 +360,29 @@ s+^.*warez.*$+No Warez

You're not sea # # Revisions : # $Log: default.filter,v $ +# Revision 1.12 2002/09/05 14:55:38 oes +# Synced with the stable branch: +# Revision 1.11.2.6 2002/08/23 14:12:26 oes +# Proofed frameset-borders against "fremaborder=0 border=0" +# +# Revision 1.11.2.5 2002/08/22 15:05:20 oes +# Added Filter to make Quicktime movies saveable (thanks to aaron@linville.org for the idea) +# +# Revision 1.11.2.4 2002/08/10 11:32:29 oes +# Attribute values in replacement tags of banners-by-size filter now undelimited. (Fixes bug #592493) +# +# Revision 1.11.2.3 2002/08/05 11:43:56 oes +# Fixed a bug in the popups filter that was introduced with the last fix :-( +# +# Revision 1.11.2.2 2002/08/01 11:20:13 oes +# Fixed bugs 587802, 577802 and an unreported one +# +# Revision 1.11.2.1 2002/07/26 15:18:26 oes +# - All filters reviewed and many shorcomings fixed +# - New filters: img-reorder, banners-by-link and js-events +# - Jobs reorderd because they are now executed in order of +# appearance +# # Revision 1.11 2002/05/24 00:57:18 oes # Made WeBugs job ungreedy; Fixes bug 559190 # -- 2.39.2