Classes/Hook/SitemapIndexLinkHook.php
protected function checkIfFileIsWhitelisted($url)
    {
        $ret = false;

        // check for valid url
        if (empty($url)) {
            return false;
        }

        // parse url to extract only path
        $urlParts = parse_url($url);
        $filePath = $urlParts['path'];

        // Extract last file extension
        if (preg_match('/\.([^\.]+)$/', $filePath, $matches)) {
            $fileExt = trim(strtolower($matches[1]));

            // Check if file extension is whitelisted
            foreach ($this->fileExtList as $allowedFileExt) {
                if ($allowedFileExt === $fileExt) {
                    // File is whitelisted, not blacklisted
                    $ret = true;
                    break;
                }
            }
        }

        return $ret;
    }
protected function checkIfFileIsWhitelisted($url)
    {
        $ret = false;

        // check for valid url
        if (empty($url)) {
            return false;
        }

        // parse url to extract only path
        $urlParts = parse_url($url);
        $filePath = $urlParts['path'];

        // Extract last file extension
        if (preg_match('/\.([^\.]+)$/', $filePath, $matches)) {
            $fileExt = trim(strtolower($matches[1]));

            // Check if file extension is whitelisted
            foreach ($this->fileExtList as $allowedFileExt) {
                if ($allowedFileExt === $fileExt) {
                    // File is whitelisted, not blacklisted
                    $ret = true;
                    break;
                }
            }
        }

        return $ret;
    }
protected function checkIfFileIsWhitelisted ( $ url ) { $ ret = false ; // check for valid url if ( empty ( $ url ) ) { return false ; } // parse url to extract only path $ urlParts = parse_url ( $ url ) ; $ filePath = $ urlParts [ 'path' ] ; // Extract last file extension if ( preg_match ( '/\.([^\.]+)$/' , $ filePath , $ matches ) ) { $ fileExt = trim ( strtolower ( $ matches [ 1 ] ) ) ; // Check if file extension is whitelisted foreach ( $ this -> fileExtList as $ allowedFileExt ) { if ( $ allowedFileExt === $ fileExt ) { // File is whitelisted, not blacklisted $ ret = true ; break ; } } } return $ ret ; }
Check if file is whitelisted

Configuration specified in
plugin.metaseo.sitemap.index.fileExtension

@param   string $url Url to file

@return  boolean
Check if file is whitelisted