<?php /** * This is a simple script to test whether the words you've * added will be properly censored in a sentence format. * * Usage via command line: /path/to/php example.php "snipe is a bitch, but she knows her shit. NO BULLSHIT." * Usage via www: /url/example.php?snipe is a bitch but she's f*****g great! NO BULLSHIT. * * Output: * ORIGINAL: snipe is a bitch, but she knows her shit. NO BULLSH!T. * SUBSITUTIONS: snipe is a bitch, but she knows her shit. NO BULLSHiT. * PROCESSED: snipe is a *****, but she knows her ****. NO BULL****. */ $badwords = array(); include 'lang/en-us.wordlist-regex.php'; include 'lang/fr.wordlist-regex.php'; include 'lang/es.wordlist-regex.php'; include 'censor.function.php'; // cli or www? if (isset($argv)) { // get input from CLI $input = htmlentities(trim($argv[1])); } else { // input is the whole querystring $input = urldecode($_SERVER['QUERY_STRING']); // no HTML header('Content-Type: text/plain'); } $censored = censorString($input, $badwords); echo "\nPURE: " . $input . "\nORIGINAL: " . $censored['orig'] . "\nPROCESSED: " . $censored['clean'] . "\n\n";
<?php include "config.php"; include "pdo.class.php"; include "ImageFilter.class.php"; include "functions.php"; $pdo = Db::singleton(); $body = censorString(cleanVar($_POST['Body'], 'text')); $from = cleanVar($_POST['From'], 'phone'); $media = ''; $numMedia = $_POST['NumMedia']; if ($numMedia > 0) { for ($i = 0; $i <= $numMedia; $i++) { $key = 'MediaUrl' . $i; $media = $_POST[$key]; if (isset($media) && !empty($media)) { $media = cache_image($media, $id); $filter = new ImageFilter(); $score = $filter->GetScore($media); if (isset($score)) { if ($score >= 30) { unlink($media); } else { $res = $pdo->query("INSERT INTO call_log SET msg='{$body}',phonenumber='{$from}',photo='{$media}',type='s'"); } } } } }