mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Fix referrer filter
7530de87d233b04d88f1fefd425c822bdf7502f4 introduced a regression: the domain parameter in refFilter() contains 'https://', which bypass the new regex; thus we readd the call to getDomainName(). Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
ecfc7ea68e
commit
bb7d26d19f
@ -1,5 +1,5 @@
|
|||||||
import { BROWSERS } from './constants';
|
import { BROWSERS } from './constants';
|
||||||
import { removeTrailingSlash, removeWWW } from './url';
|
import { removeTrailingSlash, removeWWW, getDomainName } from './url';
|
||||||
|
|
||||||
export const urlFilter = (data, { raw }) => {
|
export const urlFilter = (data, { raw }) => {
|
||||||
const isValidUrl = url => {
|
const isValidUrl = url => {
|
||||||
@ -46,7 +46,8 @@ export const urlFilter = (data, { raw }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const refFilter = (data, { domain, domainOnly, raw }) => {
|
export const refFilter = (data, { domain, domainOnly, raw }) => {
|
||||||
const regex = new RegExp(`http[s]?://([a-z0-9-]+\\.)*${domain}`);
|
const domainName = getDomainName(domain);
|
||||||
|
const regex = new RegExp(`http[s]?://([a-z0-9-]+\\.)*${domainName}`);
|
||||||
const links = {};
|
const links = {};
|
||||||
|
|
||||||
const isValidRef = referrer => {
|
const isValidRef = referrer => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user