Yii2: MultipartFormDataParser produces an ErrorException

Created on 19 Feb 2018  路  6Comments  路  Source: yiisoft/yii2

What steps will reproduce the problem?

Parse a request with using a MultipartFormDataParser.

What is the expected result?

No errors occur.

What do you get instead?

An ErrorException is being thrown:

Only variables should be passed by reference

The exception is caused by a notices generated by this line:

$lastKey = array_pop(array_keys($current));

Should we extract array_keys($current) to a separate variable to fix this?

Additional info

| Q | A
| ---------------- | ---
| Yii version | 2.0.14
| PHP version | 7.1
| Operating system | GNU/Linux

to be verified bug

Most helpful comment

@samdark the code I refer to is both in 2.0.14 and master.

All 6 comments

Please check 2.0.14.

@samdark the code I refer to is both in 2.0.14 and master.

@bscheshirwork while the link indeed, refers to the master the very same code is still in 2.0.14. Here's a link specifically for the 2.0.14.

Yes, of course.

Could you provide a test case or request content that produces this error?

Was this page helpful?
0 / 5 - 0 ratings