/** * config */ function isIgnored($name, $key) { if (!@$key) { return false; } $name = strtoupper($name); $query = sprintf("select value from #__joomlawatch_config where name='JOOMLAWATCH_IGNORE_" . $name . "' limit 1"); $this->database->setQuery($query); $rows = $this->database->loadObjectList(); $rowValue = $this->database->loadResult(); $exploded = explode("\n", $rowValue); foreach ($exploded as $value) { if (JoomlaWatchHelper::wildcardSearch(trim($value), $key)) { return true; } } return false; }
function checkPostRequestForSpam($post) { /** if nothing is there in the post request */ if (@(!$post)) { return true; } $ip = $_SERVER['REMOTE_ADDR']; if (@$this->searchBlockedIp($ip)) { $this->dieWithBlockingMessage($ip); } $today = $this->helper->jwDateToday(); if (@$this->config->getCheckboxValue('JOOMLAWATCH_SPAMWORD_BANS_ENABLED')) { $spamList = explode("\n", $this->config->getConfigValue('JOOMLAWATCH_SPAMWORD_LIST')); foreach ($post as $key => $value) { foreach ($spamList as $spamWord) { $spamWord = trim($spamWord); $value = trim($value); if (@$spamWord && @$value && JoomlaWatchHelper::wildcardSearch("*" . $spamWord . "*", $value)) { $this->blockIp($ip, htmlspecialchars($value), $today); $this->dieWithBlockingMessage($ip); } } } } }