isUrlValid example

/** * @throws MediaException */
    private function getUrlFromRequest(Request $request): string
    {
        $url = (string) $request->request->get('url');

        if ($url === '') {
            throw MediaException::missingUrlParameter();
        }

        if (!$this->isUrlValid($url)) {
            throw MediaException::invalidUrl($url);
        }

        return $url;
    }

    /** * @throws MediaException * * @return resource */
    
Home | Imprint | This part of the site doesn't use cookies.