Jump to content

Compilation failed: nothing to repeat at offset 2322


Danny620

Recommended Posts

require_once('./140dev_config.php');
require_once('./db_lib.php');
$oDB = new db;

$tweet_text = "Hello my name is user badword.";

//Moderate tweet
  	$query = 'SELECT profanity_id, profanity_word ' .
    	'FROM profanity_list';
  	$result = $oDB->select($query);
	$bad_words = array();
  	while($row = mysqli_fetch_assoc($result)) {
	  $bad_words[] = $row['profanity_word'];
  	}

	$matches = array();
	$match_found = preg_match_all(
                "/\b(" . implode($bad_words,"|") . ")\b/i", 
                $tweet_text, 
                $matches
              );

	if ($match_found) {
		echo $safe_to_show = 3;	
	}else{
		echo $safe_to_show = 1; 
	}

why does it not find the word badword

Warning: preg_match_all(): Compilation failed: nothing to repeat at offset 2322 in /home/unlockth/public_html/twitter-server/db/badwords.php on line 23

1

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.