• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Invalid file source (API)

Status
Not open for further replies.
There are several errors triggered by this URL. First thing is that PHP's default filter_var for URL (FILTER_VALIDATE_URL) doesn't recognize this URL as valid, so the G\is_url() function must be improved. I ended doing something like this:

PHP:
    // This will tell if the string is an URL
    function is_url($string) {
        // Internal PHP system
        if(filter_var($string, FILTER_VALIDATE_URL)) { // Note: This doesn't validate any non-alphanumeric URL
            return true;
        }
        // Test if it has foreign chars
        if(strlen($string) !== strlen(utf8_encode($string))) {
            $parsed_url = parse_url($string);
            if(count($parsed_url) < 2) { // At least scheme and host
                return false;
            }
            $schemes = ['http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn', 'tel', 'fax', 'xmpp'];
            if(!in_array(strtolower($parsed_url['scheme']), $schemes)) { // Must be a valid scheme
                return false;
            }
            if(!array_key_exists('host', $parsed_url)) { // Host must be there
                return false;
            }
            // At this point this thing looks like an URL
            return true;
        }
        return false;
    }

With that the thing validates as URL but then the problem is, again, the Cyrillic (actually multibyte) chars. I'm still working on it and most likely this will get patched for the next version.
 
Last edited:
Status
Not open for further replies.
Back
Top