Jump to content

Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repe


Recommended Posts

Error: Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 0 in /home/ben/public_html/Bazaark/edit_profile.php on line 142

 


 

I have a script that lets users edit their profile. The only thing I last did on it was add filters using the preg_match function; a few days a go it was working fine and since yesterday these compilation errors have been coming up. I have tried contacting my Web host about it but they are so inexperienced they say its to do with my script. I have checked my script over 100 times and the syntax and everything seems to be fine. Does anybody know what could be causing this error?

some code would be ace...

 

some based around line 142 in edit_profile would be phenominal...

 

but the actual error is down to your preg_match not having any regex patter to match against.

The starting bit of the code is line 142:

 

if(preg_match($match1,$profile) || preg_match($match2,$profile) || preg_match($match3,$profile) || preg_match($match4,$profile) || preg_match($match5,$profile) || preg_match($match6,$profile) || preg_match($match7,$profile) || preg_match($match8,$profile) || preg_match($match9,$profile) || preg_match($match10,$profile) || preg_match($match11,$profile) || preg_match($match12,$profile) || preg_match($match13,$profile) || preg_match($match14,$profile) || preg_match($match15,$profile) || preg_match($match16,$profile) || preg_match($match17,$profile) || preg_match($match18,$profile) || preg_match($match19,$profile) || preg_match($match20,$profile) || preg_match($match21,$profile) || preg_match($match22,$profile) || preg_match($match23,$profile) || preg_match($match24,$profile) || preg_match($match25,$profile) || preg_match($match26,$profile)) {
		echo "<b><font color='red'>WARNING: Your profile contained material that was recognised by our filter! This includes (without limitation); offensive and/or discriminating language, posting personal information (including mobile phone numbers), swearing, linking to websites not approved by us, etc. Go back and rectify the problem.</font></b>";
	}

 

EDIT: I found out that this error occurs when you enter text not filtered by preg_match. :S

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.