Jump to content

Warning: preg_match() [function.preg-match]: No ending delimiter '.' found


petventh

Recommended Posts

Please help me with this code. It keep appear in my website.

 

"Warning: preg_match() [function.preg-match]: No ending delimiter '.' found in /home/kengsite/public_html/wp-content/plugins/statpress/statpress.php on line 1184"

 

And this is how the line look like.

 

if (!preg_match(".ico$", $urlRequested)) { return ''; }

 

 

 

Link to comment
Share on other sites

preg uses a character to define the beginning and end of the pattern try this:

 

if (!preg_match("@.ico$@", $urlRequested)) { return ''; }

 

@ is the beginning of the pattern matching string and therefore the end. In your example, the string is looking for . at the end. There is none so it gives you a warning.

Link to comment
Share on other sites

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.