← Back to team overview

mahara-contributors team mailing list archive

[Bug 1588599] A change has been merged

 

Reviewed:  https://reviews.mahara.org/6687
Committed: https://git.mahara.org/mahara/mahara/commit/d206bb4ec8ac278bf872f5e6b51f24073bb7df98
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch:    15.04_STABLE

commit d206bb4ec8ac278bf872f5e6b51f24073bb7df98
Author: H Klocker <h.klocker@xxxxxx>
Date:   Fri Jun 3 17:15:15 2016 +1200

Bug 1588599: Fixing up Mahara for php7

Changing deprecated join() and ereg() eregi() functions to their more
robust equivalents

behatnotneeded

Change-Id: I76e928a945a0f4b0a2b7b2a3096200c2f8df9db9
Signed-off-by: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
(cherry picked from commit e7d540e52227cb6306515fa65aa9c17c665cd0f5)
(cherry picked from commit 4c6573b962f754766e664514bb7a495250c44fb1)

-- 
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:
  Fix Committed
Status in Mahara 15.04 series:
  Fix Committed
Status in Mahara 15.10 series:
  Fix Committed
Status in Mahara 16.04 series:
  Fix Committed
Status in Mahara 16.10 series:
  Fix Committed

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


References