mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #35550
[Bug 1588599] [NEW] PHP 7 unrecoverable errors in 16.04
Public bug reported:
I am porting my working instance of mahara 16.04 (debian, php 5.5) to a
new server (ubuntu 16.04, php 7.04, using git for installation). Just by
chance I stumble upon some crashes which seem to be related to using
deprecated PHP functions. At this time I found (and easily repaired) the
following files needing fixing for PHP 7:
root@QSKW001:/var/www/mahara# git status
On branch 16.04_STABLE
Your branch is up-to-date with 'origin/16.04_STABLE'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: htdocs/lib/antispam/SimpleSpamTrap.php
modified: htdocs/module/multirecipientnotification/inbox.php
modified: htdocs/module/multirecipientnotification/lib/activityextend.php
modified: htdocs/module/multirecipientnotification/outbox.php
the first one needing preg_match instead of eregi
diff lib/antispam/SimpleSpamTrap.php ../../mahara-16.04.0/htdocs/lib/antispam/SimpleSpamTrap.php
25c25
< if (preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i", $email)) {
---
> if (eregi("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$", $email)) {
while the other ones simply needed explode instead of split, e.g.:
root@QSKW001:/var/www/mahara# diff htdocs/module/multirecipientnotification/inbox.php ../mahara-16.04.0/htdocs/module/multirecipientnotification/inbox.php
78c78
< explode(',', $type),
---
> split(',', $type),
179c179
< $types = explode(',', preg_replace('/[^a-z,]+/', '', $type));
---
> $types = split(',', preg_replace('/[^a-z,]+/', '', $type));
These are just quick hacks by me working up to now.
** Affects: mahara
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1588599
Title:
PHP 7 unrecoverable errors in 16.04
Status in Mahara:
New
Bug description:
I am porting my working instance of mahara 16.04 (debian, php 5.5) to
a new server (ubuntu 16.04, php 7.04, using git for installation).
Just by chance I stumble upon some crashes which seem to be related to
using deprecated PHP functions. At this time I found (and easily
repaired) the following files needing fixing for PHP 7:
root@QSKW001:/var/www/mahara# git status
On branch 16.04_STABLE
Your branch is up-to-date with 'origin/16.04_STABLE'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: htdocs/lib/antispam/SimpleSpamTrap.php
modified: htdocs/module/multirecipientnotification/inbox.php
modified: htdocs/module/multirecipientnotification/lib/activityextend.php
modified: htdocs/module/multirecipientnotification/outbox.php
the first one needing preg_match instead of eregi
diff lib/antispam/SimpleSpamTrap.php ../../mahara-16.04.0/htdocs/lib/antispam/SimpleSpamTrap.php
25c25
< if (preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i", $email)) {
---
> if (eregi("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$", $email)) {
while the other ones simply needed explode instead of split, e.g.:
root@QSKW001:/var/www/mahara# diff htdocs/module/multirecipientnotification/inbox.php ../mahara-16.04.0/htdocs/module/multirecipientnotification/inbox.php
78c78
< explode(',', $type),
---
> split(',', $type),
179c179
< $types = explode(',', preg_replace('/[^a-z,]+/', '', $type));
---
> $types = split(',', preg_replace('/[^a-z,]+/', '', $type));
These are just quick hacks by me working up to now.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1588599/+subscriptions
Follow ups
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-10-21
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Son Nguyen, 2016-07-11
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-07-11
-
[Bug 1588599] A change has been merged
From: Mahara Bot, 2016-07-11
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-07-11
-
[Bug 1588599] A change has been merged
From: Mahara Bot, 2016-07-11
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-07-11
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-07-11
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-07-10
-
[Bug 1588599] A patch has been submitted for review
From: Mahara Bot, 2016-07-10
-
[Bug 1588599] A patch has been submitted for review
From: Mahara Bot, 2016-07-10
-
[Bug 1588599] A change has been merged
From: Mahara Bot, 2016-06-09
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-06-09
-
[Bug 1588599] A patch has been submitted for review
From: Mahara Bot, 2016-06-09
-
[Bug 1588599] A change has been merged
From: Mahara Bot, 2016-06-09
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Aaron Wells, 2016-06-09
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-06-09
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Kristina Hoeppner, 2016-06-03
-
[Bug 1588599] A patch has been submitted for review
From: Mahara Bot, 2016-06-03
-
[Bug 1588599] Re: PHP 7 unrecoverable errors in 16.04
From: Robert Lyon, 2016-06-03