
<center><h2><strong>Ubuntu</strong></h2>
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php
/**
 * Module Name: Block Bad Referers
 * Description: If you don't want that some website can link to yours, use this plugin.
 * Main Module: firewall
 * Author: SecuPress
 * Version: 2.0
 */

defined( 'ABSPATH' ) or die( 'Something went wrong.' );

if ( isset( $_SERVER['HTTP_REFERER'] ) && ! empty( $_SERVER['HTTP_REFERER'] ) ) {
	$referers = array_filter( explode( "\n", secupress_get_module_option( 'bbq-headers_bad-referer-list', [], 'firewall' ) ) );
	if ( ! $referers ) {
		return;
	}
	foreach ( $referers as $ref ) {
		if ( 0 === strpos( $_SERVER['HTTP_REFERER'], trim( $ref ) ) ) {
			secupress_block( 'BRU', [ 'code' => 400, 'b64' => [ 'data' => esc_html( $_SERVER['HTTP_REFERER'] ) ] ] );
		}
	}
}
