preg_replace() error

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
thomahawk
Power Poster
Power Poster
Posts: 293
Joined: Fri Jul 25, 2008 10:13 am
Location: Zug, Switzerland

preg_replace() error

Post by thomahawk »

Hello CMSMS friends

My provider is upgrading PHP to 7.2 and some of my CMSMS installations, which otherwise work well, stop displaying photo galleries.

Error message is this (it only displays under PHP 7.1):
Warning: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead in /home/zugergra/www/bakoro.ch/lib/html_entity_decode_php4.php on line 306

Warning: preg_replace() [function.preg-replace.php]: The /e modifier is no longer supported, use preg_replace_callback instead in /home/zugergra/www/bakoro.ch/lib/html_entity_decode_php4.php on line 307


So I tried to change that in html_entity_decode_php4.php
When I change just the two "preg_replace"... to "preg_replace_callback"... the gallery starts working again, only that it displays another error on top regarding the rest of that code. So I took that whole part of the code from the html_entity_decode_php4.php that is used in the actual CMSMS 2.x but it caused a whole lot of other errors.

Has someone a suggestion what I can try to change on those two lines of PHP so the errors disappear?

My CMSMS installations are 1.11.11 or 1.11.9, Gallery Module 1.6 or 2.0.3 and the like. Thing is, updating CMSMS is not possible because many custom adaption were originally made that would all have to be made again, websites are non-profit so we have to solve it as easy as possible. As it is a minor PHP problem, better changing that specific code only.

Thanks for any suggestion,
Thom
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: preg_replace() error

Post by Rolf »

FYI, the next release of CMSMS - 2.2.8 - will have several fixes for PHP 7.2
This version is now in testing and voting stage, so release won't take long.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1619
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: preg_replace() error

Post by DIGI3 »

What are these custom adaptations that prevent you from upgrading?
There are a lot of security updates and improvements since 1.11, it's quite important that you figure out a way to upgrade to the latest, and you won't receive support from the dev team with a version that old.

If it's just template changes then there's usually little or nothing to change when upgrading, but if you've hacked the core for some reason then you should probably find a better way to do it.
Not getting the answer you need? CMSMS support options
Post Reply

Return to “CMSMS Core”