Jump to content

No ending delimiter '^' found in ...


rendsonn

Recommended Posts

I'm having trouble with a role in a wordpress site that I made

I think the script was that I installed another version, so I

some adjustments in it, among those changes have modified this function

 

if (@$_GET['src'] && !@$PHPTHUMB_CONFIG['allow_local_http_src'] && eregi('^http://'.@$_SERVER['HTTP_HOST'].'(.+)', @$_GET['src'], $matches)) {

$phpThumb->ErrorImage('It is MUCH better to specify the "src" parameter as "'.$matches[1].'" instead of "'.$matches[0].'".'."\n\n".'If you really must do it this way, enable "allow_local_http_src" in phpThumb.config.php');

}

for this:

(@$_GET['src'] && !@$PHPTHUMB_CONFIG['allow_local_http_src'] && preg_match('^http://'.@$_SERVER['HTTP_HOST'].'(.+)', @$_GET['src'], $matches)) {

$phpThumb->ErrorImage('It is MUCH better to specify the "src" parameter as "'.$matches[1].'" instead of "'.$matches[0].'".'."\n\n".'If you really must do it this way, enable "allow_local_http_src" in phpThumb.config.php');

}

 

 

It was supposed to make some images appear as thumbnails on the home page

my site, but they do not appear and I got the following error:

Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in /home/pontocom/public_html/wp-content/themes/Comfy/scripts/phpThumb/phpThumb.php on line 160

 

Is there some way that I can take to fix this error?

 

Link to comment
Share on other sites

Why do people do this:@$_GET['src'] I never quite understand why people do this, why suppress errors? Surely you want to know EVERYTHING that could be erroneous with your code... The only exception I know to this 'rule' is some of the XML functions, that even php.net documentation state, that in order to get it to functional you will need to use the @ symbol to get the desired functionality.

 

Secondly: Word of advice (though using older versions should be ok) If you put error_reporting(E_ALL|E_DEPRECATED); on in the file you are working on, you should get a notice to say that ereg_ functions are now deprecated, this means that, should you come to migrate servers in the future, some of the functionality of you code won't or wouldn't perform as desired.

 

[EDIT] Then I re read the first post and wish I had pressed preview instead of post! Read some preg stuff from the manual

 

Rw

Link to comment
Share on other sites

use

('/^http://'.@$_SERVER['HTTP_HOST'].'(.+)/',

 

because you started your regexp with ^ it expect it to end the pattern with ^

that's why people mostly use / pattern / or  ~ pattern ~

 

I get this:

Warning: preg_match() [function.preg-match]: Unknown modifier '/' in

 

I'll read the manual and see if I can find another way to insert this script, anything I post here again

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.