SquidGuard does not allow characters in domains like "äöü" like www.müller.de



  • Hi,

    domains allow characters like äöü like www.müller.de
    But the regex in squidguard_configurator.inc does not allow these characters. I am no regex expert that's why I post this here and hope that someone can fix that.

    I think in must be in these lines:
    Line 1620:

    
    # ------------------------------------------------------------------------------
    # is_domain_valid - check domain format
    # ------------------------------------------------------------------------------
    function is_domain_valid($domain)
    {
        $dm_fmt = "([a-z0-9\-]{1,})";
        $dm_fmt = "/^(($dm_fmt{1,}\.){1,}$dm_fmt{2,})+$/i"; # example: (my.)(super.)(domain.)com
        return is_string($domain) && preg_match($dm_fmt, trim($domain));
    }
    
    

    Line 1575:

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


  • You url www.müller.de will be converted by browser to punycode http://www.xnmller-kva.de/ ( SG view last url only )
    You must use one of services ( for example http://www.charset.org/punycode.php ) for converting you national url to punycode and use this in the SG filter.



  • @dvserg:

    You url www.müller.de will be converted by browser to punycode http://www.xnmller-kva.de/ ( SG view last url only )
    You must use one of services ( for example http://www.charset.org/punycode.php ) for converting you national url to punycode and use this in the SG filter.

    Great! I never heard of that. Thank you very much!


Locked