ObsceneClean Version 0.3 beta - a profanity filter. Copyright (C) 2011 Scott L. Moore This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA WARNING: The source code may contain highly offensive language.! Contact: scottlmoore@hotmail.com */ // // This script is called by ULTRA-FAST-EXAMPLE-Form.html // // We assume the settings file is all set to defaults. // This especially script requires $ObsceneCleanReturnValue to be set to zero. // include_once "DetectOWs2.php"; include_once "ObsceneClean.settings.php"; if (empty($_POST)) { echo '<br>Empty post. Please enter text.'; exit; } $checkstr = $_POST['checkstr']; if (ObsceneCleanDetectOWs2($checkstr)) { sleep(1); // Make the offending user wait a long time! Up this to at least 30! /* On the next line, instead of "you entered bad word" message we output a deliberately confusing error message about "Internal Server". It is best to confuse an offending user! Do NOT antagonize them! */ echo "<font size=\"+2\">" . '<br> HTTP Error 500.19 - Internal Server Error <br> The requested page cannot be accessed because the related configuration data for the page is invalid. ' . "</font>"; } else { echo '<br><br><br><br> POST the POST because its NOT offensive.'; }
echo '-<br><br><br> ProcessPosts.php -- OWs stands for Offensive words. OEs Stands for Offensive expressions.'; $cnt = count($AllOWsFound); // echo '<br><br><br><br>'; print_r($AllOWsFound); echo '<br><br><br><br>'; if ($cnt > 0) { echo '<br>'; for ($i = 0; $i < $cnt; $i++) { $sound_val = $AllOWsFound[$i]['soundalike'] ? 'true' : 'false'; $homonym_val = $AllOWsFound[$i]['homonym'] ? 'true' : 'false'; echo '<br>#' . $i . ' OW Found=' . $AllOWsFound[$i]['OW'] . ' OW Referenced=' . $AllOWsFound[$i]['OWReferenced'] . ' Position=' . $AllOWsFound[$i]['position'] . ' Severity=' . $AllOWsFound[$i]['sev'] . ' Recognizability=' . $AllOWsFound[$i]['recognizability'] . ' Category=' . $AllOWsFound[$i]['cat'] . ' Subcategory=' . $AllOWsFound[$i]['subcat'] . ' Soundalike=' . $sound_val . ' Homonym=' . $homonym_val . ' Inital weight=' . $AllOWsFound[$i]['weight'] . ' Probability of offensiveness=' . $AllOWsFound[$i]['probability'] . ' Plural suffix=' . $AllOWsFound[$i]['pluralsuffix']; } } else { echo '<br> No OWs Found.'; } } if ($ReturnType == 4) { $AllOWsOEs = ObsceneCleanDetectOWs2($checkstr); echo '-<br><br><br> ProcessPosts.php -- OWs stands for Offensive words. OEs Stands for Offensive expressions.'; $cnt = count($AllOWsOEs); $AllOWsFound = $AllOWsOEs[0]; $cnt = count($AllOWsFound); // echo '<br><br><br><br>'; print_r($AllOWsFound); echo '<br><br><br><br>'; if ($cnt > 0) { echo '<br>'; for ($i = 0; $i < $cnt; $i++) { $sound_val = $AllOWsFound[$i]['soundalike'] ? 'true' : 'false'; $homonym_val = $AllOWsFound[$i]['homonym'] ? 'true' : 'false'; echo '<br>#' . $i . ' OW Found=' . $AllOWsFound[$i]['OW'] . ' OW Referenced=' . $AllOWsFound[$i]['OWReferenced'] . ' Position=' . $AllOWsFound[$i]['position'] . ' Severity=' . $AllOWsFound[$i]['sev'] . ' Recognizability=' . $AllOWsFound[$i]['recognizability'] . ' Category=' . $AllOWsFound[$i]['cat'] . ' Subcategory=' . $AllOWsFound[$i]['subcat'] . ' Soundalike=' . $sound_val . ' Homonym=' . $homonym_val . ' Inital weight=' . $AllOWsFound[$i]['weight'] . ' Probability of offensiveness=' . $AllOWsFound[$i]['probability'] . ' Plural suffix=' . $AllOWsFound[$i]['pluralsuffix']; } } else { echo '<br> No OWs Found.'; }