Menu

#543 Update SafeSearch options in URLfilter.cgi

Next major version
open
nobody
None
5
2015-05-21
2015-05-21
Linux_lad
No

I have been working with the safesearch option in the url filtering and found an issue if the search engine you use is in a subdomain not a TLD.

So under current regex it will work for google.com or google.be but fail to rewrite google.co.uk or google.co.jp. A similar issue occurs with Yahoo if you are not in the USA in that your country code gets added to your search string and this causes the rewrite to fail for countries other than the US EG yahoo.com/uk/.....

This is all a mute point unless you change DNS for goolge to use the noSSL option or use SSL Bump (see other feature request)

if you go to line 3018 in the urlfilter.cgi you can see the changes -

if ($filtersettings{'ENABLE_SAFESEARCH'} eq 'on') {

These 2 alternatives for Google safe search ar currently under investigation

s@(^http[s]?://[0-9a-z]+.google\.[a-z]+[-/%.0-9a-z]/.(\?|q=).*)\@\1&safe=vss\@i

s@(.\Wgoogle\.\w+/)(.)\@forcesafesearch.google.com/\2\@i

Added additional regex to match search engines who's Domain is in a subdomain, as in .co.uk or .co.jp

Also modified to catch search engines on Yahoo other than USA which have a country code after the

Yahoo.com for example yahoo.com/uk/

Removed the WALL search engine no longer as this no longer exists

    print FILE <<END

rewrite rew-rule-safesearch {
# rewrite safesearch
s@(.\Wgoogle\.\w+/(webhp|search|imghp|images|grphp|groups|frghp|froogle)\?)(.)(\bsafe=\w+)(.)\@\1\3safe=strict\5\@i
s@(.
\Wgoogle\.\w+/(webhp|search|imghp|images|grphp|groups|frghp|froogle)\?)(.)\@\1safe=strict\\&\3\@i
s@(.
\Wbing\.\w+/)(.)(\badlt=\w+)(.)\@\1\2\4&adlt=strict\@i
s@(.\Wsearch\.yahoo\.\w+/search\W)(.)(\bvm=\w+)(.)\@\1\2vm=r\4\@i
s@(.
\Wsearch\.yahoo\.\w+/search\W.)\@\1\\&vm=r\@i
s@(.
\..\Wsearch\.yahoo\.\w+/search\W)(.)(\bvm=\w+)(.)\@\1\2vm=r\4\@i
s@(.
\..\Wsearch\.yahoo\.\w+/search\W.)\@\1\\&vm=r\@i
s@(.\Wgoogle\..\.\w+/(webhp|search|imghp|images|grphp|groups|frghp|froogle)\?)(.)(\bsafe=\w+)(.)\@\1\3safe=strict\5\@i
s@(.\Wgoogle\..\.\w+/(webhp|search|imghp|images|grphp|groups|frghp|froogle)\?)(.*)\@\1safe=strict\\&\3\@i
}

END

cheers -

1 Attachments

Discussion


Log in to post a comment.