SquidGuard: Target categories: Edit: URLs List -> ERROR in last octett



  • Hi,

    i have aproblem in the "target categories" tab when editing "URLs list".

    If I use the following URL it is not working:

    
    172.171.110.1/alisa
    172.171.110.2/alisa
    172.171.110.3/alisa
    172.171.110.4/alisa
    172.171.110.5/alisa
    172.171.110.6/alisa
    172.171.110.7/alisa
    172.171.110.8/alisa
    172.171.110.9/alisa
    
    

    In the last octett there are only numbers from 1 till 9.

    It is working when using numbers which are higher than 9.
    so this will work:

    
    172.171.110.10/alisa
    172.171.110.123/alisa
    172.171.110.57/alisa
    
    

    But what is strange for me is that this is working, too:

    
    172.171.110.07/alisa
    172.171.110.04/alisa
    
    

    I had a look in the .inc and .xml files but didn't found why this is not working.
    But would be really nice if this could be fixed.

    Thanks



  • isn't there anyone else having this issue ? is it just my configuration ?



  • @Nachtfalke:

    isn't there anyone else having this issue ? is it just my configuration ?

    Same as me. I think this is the bug of SquidGuard.



  • Ok, now we just have to find the bug :D


  • Rebel Alliance Developer Netgate

    That isn't meant to use IPs there. The regex in the function is meant to match domain names only. It just happens that the IPs match the regex when the last item after the last . before / is 2 characters or more.

    In /usr/local/pkg/squidguard_configurator.inc at line 1545

    # url as 'domain/path': 'mydomain.com/index.php'
    function is_dest_url($url)
    {
        $fmt  = "[a-zA-Z0-9_-]";
    
        if (empty($url)) return false;
        if (eregi("^(($fmt){1,}\.){1,}($fmt){2,}(/(.[^\*][^ ])*)", $url)) return true;
        return false;
    }
    
    

Locked