0, 'bsi' => 0 === strpos( get_locale(), 'de' ) ? 1 : 0, 'cisa' => 1, 'nvd' => 1, 'cvss' => 9.0, 'days' => 60, 'fresh' => 14, 'menu_dot' => 0, 'subscribe_pos' => 'bottom', 'share_pos' => 'bottom', 'nvd_key' => '', 'page_id' => 0, 'intro' => '', 'cta_text' => '', 'cta_url' => '', 'credit' => 0, 'accent' => '#2271b1', 'products' => implode( "\n", array( 'Microsoft', 'Windows', 'Exchange', 'SharePoint', 'Citrix', 'NetScaler', 'Fortinet', 'FortiGate', 'FortiOS', 'FortiWeb', 'FortiClient', 'Cisco', 'Palo Alto', 'PAN-OS', 'Ivanti', 'SonicWall', 'WatchGuard', 'Sophos', 'Juniper', 'F5', 'BIG-IP', 'Check Point', 'VMware', 'ESXi', 'vCenter', 'Veeam', 'Synology', 'QNAP', 'Java', 'WebLogic', 'PHP', 'OpenSSL', 'OpenSSH', 'Apache', 'nginx', 'Tomcat', 'Chrome', 'Firefox', 'Thunderbird', 'Safari', 'Apple', 'iOS', 'macOS', 'Android', 'Adobe', 'Acrobat', 'WordPress', 'Confluence', 'Jira', 'SAP', 'Zoom', 'TeamViewer', '7-Zip', 'WinRAR', ) ), ); } /** * Current settings merged with defaults. * * @return array */ function cpradar_settings() { return wp_parse_args( (array) get_option( 'cpradar_settings', array() ), cpradar_defaults() ); } /** * Product names from the settings, one per line. * * @return string[] */ function cpradar_products() { $list = preg_split( '/\r\n|\r|\n|,/', (string) cpradar_settings()['products'] ); return array_values( array_filter( array_map( 'trim', $list ) ) ); } /** * All product names that occur in the text as whole words, in order of appearance. * * @param string $text Text to search. * @param bool $match_case Exact capitalisation (used for English NVD descriptions). * @return string[] */ function cpradar_matches( $text, $match_case = false ) { $found = array(); foreach ( cpradar_products() as $p ) { $pattern = '/(?/ and the feed. */ function cpradar_rewrite_rules() { $path = cpradar_page_path(); if ( '' !== $path ) { add_rewrite_rule( '^' . preg_quote( $path, '#' ) . '/alert/([A-Za-z0-9\-]+)/?$', 'index.php?pagename=' . $path . '&cpradar_alert=$matches[1]', 'top' ); } add_feed( CPRADAR_FEED, 'cpradar_render_feed' ); } add_action( 'init', 'cpradar_rewrite_rules' ); add_filter( 'query_vars', function ( $vars ) { $vars[] = 'cpradar_alert'; return $vars; } );