** Changed in: mahara/16.04
       Status: New => Confirmed

** Changed in: mahara/15.10
       Status: New => Confirmed

** Changed in: mahara/15.04
       Status: New => Confirmed

-- 
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:
  In Progress
Status in Mahara 15.04 series:
  Confirmed
Status in Mahara 15.10 series:
  Confirmed
Status in Mahara 16.04 series:
  Confirmed
Status in Mahara 16.10 series:
  In Progress

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

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to