def allowed_file(filename):
    """Checks uploaded file extension.

    Checks if file is allowed to upload (by its extension only). Source:
        `Flask Documentation <http://flask.pocoo.org/docs/0.12/patterns/fileuploads/>`_.

    Args:
        filename (str): File name.

    Returns:
        bool: Whether file is allowed to upload.
    """

    return not ('.' in filename and \
            filename.rsplit('.', 1)[1].lower() in set([
                'html', 'htm', 'xhtml', 'php'
            ]))