PHP7 and the preg_replace problem

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Suggested Hosts
User avatar
AmigoJack
Registered User
Posts: 5263
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: PHP7 and the preg_replace problem

Post by AmigoJack » Wed Nov 01, 2017 7:50 am

open-your-eyes wrote:
Tue Oct 31, 2017 7:48 pm
tell me what to do
Read my comment in the ticket (and maybe all my posts in this topic). I won't hand out a specific list - I explained everything already.
The worst thing about censorship is ███████████

User avatar
Ger
Recognised Extension Developer
Posts: 1593
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: PHP7 and the preg_replace problem

Post by Ger » Wed Nov 01, 2017 7:59 am

open-your-eyes wrote:
Tue Oct 31, 2017 7:48 pm
Can you please tell me what to do?
Upgrade to 3.2

3.0 has reached End of Life almost 2 years ago.
My extensions: Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update and Modern Quote
Newest: Quoted Where + anonymize

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
bbthailand
Translator
Posts: 56
Joined: Wed Jun 18, 2008 6:00 am
Contact:

Re: PHP7 and the preg_replace problem

Post by bbthailand » Thu Dec 14, 2017 10:35 am

Code: Select all

$this->message = preg_replace_callback($regexp, function($matches) use($replacement) {eval('$str=' . $replacement[1]); return $str;}, $this->message);
Work for me

User avatar
open-your-eyes
Registered User
Posts: 59
Joined: Mon Jul 31, 2017 8:20 am

Re: PHP7 and the preg_replace problem

Post by open-your-eyes » Fri Dec 15, 2017 4:39 pm

Where do you put that code, bbthailand?
My forum: Under construction...

FoulFoot
Registered User
Posts: 261
Joined: Mon Jun 23, 2003 1:04 am
Location: Honolulu, HI
Contact:

Re: PHP7 and the preg_replace problem

Post by FoulFoot » Fri Dec 15, 2017 8:54 pm

There's a lot more to fix than just that one line.

See the guide here: https://forum.dion-designs.com/t9154/ma ... th-php-70/

Foul

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16680
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: PHP7 and the preg_replace problem

Post by DavidIQ » Fri Dec 15, 2017 9:01 pm

open-your-eyes wrote:
Fri Dec 15, 2017 4:39 pm
Where do you put that code, bbthailand?
According to your signature your forum is still under construction. If that's the case then why would you even bother with 3.0? :roll:
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
open-your-eyes
Registered User
Posts: 59
Joined: Mon Jul 31, 2017 8:20 am

Re: PHP7 and the preg_replace problem

Post by open-your-eyes » Fri Dec 15, 2017 9:21 pm

Don't believe anything you see or hear. :)
My forum: Under construction...

mrgtb
Registered User
Posts: 532
Joined: Wed Oct 03, 2007 10:51 am

Re: PHP7 and the preg_replace problem

Post by mrgtb » Sun Jan 07, 2018 4:46 pm

Frank Rizzo wrote:
Sun May 17, 2015 10:47 am
I note the bugtracker records for this problem such as here:

https://tracker.phpbb.com/browse/PHPBB3-13832

The issue is that 3.0.x and 3.1.x are using preg_replace with the /e modifier, which is deprecated in PHP7.
Just out of interest seeing as I run heavily modified 3.1 board, there's no way I can upgrade to 3.2. Is it simply a case of replacing preg_replace with something else in all files used by phpBB 3.1 to make it PHP 7 compatible. As that can done quite easy really using something like NotePad++ and doing a search and replace on mass files open up in it at once

I don't mind doing it as a test run with my forum is that's all which needs be replaced with something else (every instance of "preg_replace") used in files. But is that all that's stopping it from being PHP 7 compatible

nl2dav
Registered User
Posts: 102
Joined: Tue Jun 25, 2002 10:39 pm
Location: NOP, The Netherlands
Contact:

Re: PHP7 and the preg_replace problem

Post by nl2dav » Tue Jan 09, 2018 5:51 pm

Eehh well yes.. Thats basically about it, together with the capt-cha problem.

I followed these instructions from this German website; http://www.stephan-frank.de/board/index.php?topic=2.0 .. It's 3.0 code though. Not that it is much different from 3.1 or 3.2. Some people pretend like that a lot is changed but the core code is still the same. (Hence the .1 and .2 suffix).

My forum is that much altered that I don't want to update to 3.2.. I tried though! But then I discovered that 3.2 has a cron running which changes every posting in the database in favor of this new Twig template engine stuff which I do not care about to begin with (yes, sorry).. And there is some massive extra file usage overhead and parsing which is not needed in my situation. I simply like the old template system, it's not bad, just harder to learn.

---
So anyone who likes to stick with 3.0, or 3.1 ... It's pretty easy to do, just some small changes need to be made to make it PHP7.0 compatible. (7.1 or 7.2 I do not know, it doesn't make sense for me yet to upgrade to those PHP versions).

The only major problem is Tapatalk, which I chosen to keep running in a PHP5.6 environment until somebody creates a better phone app for phpBB.

User avatar
canonknipser
Registered User
Posts: 1558
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: PHP7 and the preg_replace problem

Post by canonknipser » Tue Jan 09, 2018 7:28 pm

nl2dav wrote:
Tue Jan 09, 2018 5:51 pm
7.1 or 7.2 I do not know, it doesn't make sense for me yet to upgrade to those PHP versions
7.0 has already reached EOL and only gets security updates: http://php.net/supported-versions.php (as a remark: 5.6 security support runs approx. 1 month longer :D) . So you can even stay on 5.6 to be on the same security level...
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

Post Reply

Return to “phpBB Discussion”

Who is online

Users browsing this forum: No registered users and 25 guests