Forums / General Questions / Unknown modifier '6' in /includes/modules/additional_images.php on line 48

Unknown modifier '6' in /includes/modules/additional_images.php on line 48

Views: 1,564

Results 1 to 6 of 6
11 Sep 2011, 8:21 AM
#1
scottmcclean avatar

scottmcclean

Zen Follower

Join Date:
Mar 2009
Location:
Trowbridge, Wiltshire
Posts:
121
Plugin Contributions:
0

Unknown modifier '6' in /includes/modules/additional_images.php on line 48

Hi all,
I am getting the following error but am not sure why....

PHP Warning: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Unknown modifier '6' in /includes/modules/additional_images.php on line 48

The corresponding code on line 48 is:
if(preg_match("/" . $products_image_base . "/i", $file) == "1") {

Can anyone point me in the right direction as to what the "unknown modifier" is?

many thanks

11 Sep 2011, 2:02 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Unknown modifier '6' in /includes/modules/additional_images.php on line 48

You've probably got an image whose filename contains characters which are confusing the regex, such as apostrophes or square brackets or parentheses.

See the Similar Threads section below for some related discussion.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Sep 2011, 7:21 PM
#3
scottmcclean avatar

scottmcclean

Zen Follower

Join Date:
Mar 2009
Location:
Trowbridge, Wiltshire
Posts:
121
Plugin Contributions:
0

Re: Unknown modifier '6' in /includes/modules/additional_images.php on line 48

Thanks DrByte,
firstly, apologies for late response. I have gone through the images and I did find one or two that did contain parentheses. But I am now getting another type of warning:

preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Unknown modifier '3' in /includes/modules/additional_images.php on line 48.

I cannot figure this out...however, is this a "major" problem that needs to be tracked down and fixed, or is there a way to suppress these debug files - I am getting them every couple of minutes and have to keep clearing down the cache every other day.

I would really appreciate your steer on this.

13 Sep 2011, 8:35 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Unknown modifier '6' in /includes/modules/additional_images.php on line 48

Other than letters and numbers and periods, why are you using other symbols in your image filenames? Is there any reason why you can't change that?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Sep 2011, 11:43 AM
#5
scottmcclean avatar

scottmcclean

Zen Follower

Join Date:
Mar 2009
Location:
Trowbridge, Wiltshire
Posts:
121
Plugin Contributions:
0

Re: Unknown modifier '6' in /includes/modules/additional_images.php on line 48

The only other symbols that i Can see are the underscore "_" and some hyphens (-).

I will go through and change these to see if that is the problem.

Many thanks

15 Sep 2011, 2:16 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Unknown modifier '6' in /includes/modules/additional_images.php on line 48

You could change that line to say this instead (taken from v1.5.0beta):```
if(preg_match('/[B]\Q[/B]' . $products_image_base . '[B]\E[/B]/i', $file) == [B]1[/B]) {

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.