Need to tidy up code for deprecated php functions

Bug #1752743 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Rebecca Blundell

Bug Description

The following functions that are used in Mahara will be deprecated for PHP 7.2

- create_function()
- each()

So should be replaced with better code.

the create_function() can be replaced with the use of an anonymous function and each() should be altered to work with a foreach loop instead

And the function assert() should be checked to make sure the argument is not a string to be evaluated

Robert Lyon (robertl-9)
Changed in mahara:
milestone: none → 18.04.0
status: New → Confirmed
importance: Undecided → Medium
Changed in mahara:
milestone: 18.04.0 → 18.10.0
Changed in mahara:
assignee: nobody → Rebecca Blundell (rjb-dev)
status: Confirmed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/8905

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8905
Committed: https://git.mahara.org/mahara/mahara/commit/c6c6c295b4872e9e3f871862484af6a9a0cb3291
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit c6c6c295b4872e9e3f871862484af6a9a0cb3291
Author: Rebecca Blundell <email address hidden>
Date: Tue May 29 13:50:31 2018 +1200

Bug 1752743: replace php 7.2 deprecated functions

replaced each() with foreach in core code.
replaced create_function() with anonymous function in core code.

Also removed some functions that were not used anymore

behatnotneeded

Change-Id: I300396a1ec04c75d7882b7ec5c9de76c3763e70d

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.