bp_document_protect_download_rewite_rules( string $rewrite )

Protect downloads from ms-files.php in multisite.

Description

Parameters

$rewrite

(Required) rewrite rules.

Return

(string)

Source

File: bp-document/bp-document-filters.php

function bp_document_protect_download_rewite_rules( $rewrite ) {
	if ( ! is_multisite() ) {
		return $rewrite;
	}

	$rule  = "\n# Document Rules - Protect Files from ms-files.php\n\n";
	$rule .= "<IfModule mod_rewrite.c>\n";
	$rule .= "RewriteEngine On\n";
	$rule .= "RewriteCond %{QUERY_STRING} file=document_uploads/ [NC]\n";
	$rule .= "RewriteRule /ms-files.php$ - [F]\n";
	$rule .= "</IfModule>\n\n";

	return $rule . $rewrite;
}

Changelog

Changelog
Version Description
BuddyBoss 1.4.1 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.