Problem/Motivation
On line 714 of filter.module we check whether $filter->settings exists before unserializing it and then merging it into another array on line 717.
However, as unserialize() returns FALSE on a fail, this can lead to "Fatal error: Unsupported operand types".
This may occur if $filter->settings is set to something other than an array (unlikely), or the unserialize() operation fails due to an encoding problem. An example of the kind of encoding problem that can occur is if an sql dump is uploaded with an incorrect encoding, or it is uploaded with the correct encoding, but its actual encoding is different.
Some examples of this occurring are noted in #1363580.
Proposed resolution
$filter->settings should be correctly initialised as an array prior to the merge operation, even if unserialise() has failed. It may be desirable to show a warning in this case.
Remaining tasks
- Roll a patch
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#3 | filter_type_cast-2378951-3.patch | 858 bytes | madhavvyas |
Comments
Comment #1
Jorge Navarro CreditAttribution: Jorge Navarro commentedComment #2
xtfer CreditAttribution: xtfer at Komosion commentedComment #3
madhavvyas CreditAttribution: madhavvyas as a volunteer and at CIGNEX commentedFixed array type casting issue in filter module