You use filter_vars in the url parser of yours, but it doesn't accept internationalized domain names (maybe different with php7).
Source: http://php.net/manual/en/filter.filters.validate.php
Just wanted to point that out, maybe put it in your documentation or so.