[] operator not supported for strings

Bug #1713598 reported by Robert Lyon
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

This error can happen when a variable is defined as a string to begin with then is treated as an array, for example:

$test = '';

Then

$test[] = 'cats';

Tags: php71
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/7953

Revision history for this message
Robert Lyon (robertl-9) wrote :

This seems to be the the reason of the error here
https://mahara.org/interaction/forum/topic.php?id=8030&offset=0&limit=10#post32239

But as the error doesn't mention where the error stems from in the code it will a matter of trying to find where we set up variables as strings then try and treat them as arrays by assigning something to them in the array way

Changed in mahara:
status: New → In Progress
importance: Undecided → Medium
tags: added: php71
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit bed303c9dba16f503e9ffa1169b5a40e8337f085
Author: Robert Lyon <email address hidden>
Date: Tue Aug 29 13:15:50 2017 +1200

Bug 1713598: set a potential array up as empty array and not string

behatnotneeded

Change-Id: I6bb781bb556202cdfadf08997e0da8e22ca26352
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
milestone: none → 17.10.0
Robert Lyon (robertl-9)
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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