X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilter%2Fblacklist_filter.php;h=cc8f8c5e9d0b64bf693ce654c965f73493317667;hb=a524135c24dd0a8fa359c9a92399467d50fd69e0;hp=00e886c5328dd6623515b1add97c31c9b53cb4d5;hpb=b624e45282e31944d7b72742ba0aa826862850dd;p=mailer.git diff --git a/inc/filter/blacklist_filter.php b/inc/filter/blacklist_filter.php index 00e886c532..cc8f8c5e9d 100644 --- a/inc/filter/blacklist_filter.php +++ b/inc/filter/blacklist_filter.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2016 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -74,6 +74,29 @@ function FILTER_CHECK_IP_BLACKLISTED ($filterData) { return $filterData; } +// Filter to check URL against blacklist +function FILTER_CHECK_URL_BLACKLISTED ($filterData) { + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); + // And shall I check that his URL is not in the black list? + if ((isUrlBlacklistEnabled()) && (isUrlBlacklisted($filterData['url']))) { + // Create redirect-URL + $filterData['redirect'] = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $GLOBALS['blacklist_data'][$filterData['url']]['timestamp']; + interruptFilterChain(); + + // Set data for next filter chain + $filterData['init_done'] = FALSE; + $filterData['blacklisted'] = 'url'; + $filterData['message'] = '{--URL_IS_BLACKLISTED--}'; + + // Run filter chain for successful detection (don't rely on other fields than 'IP') here + runFilterChain('post_url_blacklisted', $filterData); + } // END - if + + // Return the data for next filter + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!'); + return $filterData; +} + // Filter for logging blacklisted email addresses, is being called from above filter function FILTER_LOG_EMAIL_BLACKLISTED ($filerData) { // Make sure, that required data is there @@ -96,5 +119,16 @@ function FILTER_LOG_IP_BLACKLISTED ($filerData) { return $filterData; } +// Filter for logging blacklisted URLs, is being called from above filter +function FILTER_LOG_URL_BLACKLISTED ($filerData) { + // Make sure, that required data is there + assert((isset($filterData['init_done'])) && ($filterData['blacklisted'] == 'url')); + + // @TODO Insert log entry + + // Return filtered data + return $filterData; +} + // [EOF] ?>