Project

General

Profile

Actions

Bug #80075

closed

PHP 7.1: QueryGenerator declares $this->queryConfig as an array but it used as array and string.

Added by Christer V over 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
Start date:
2017-03-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

When using PHP 7.1 the DB Check module throws an exception when using the advanced search functionality, because of $this->queryConfig being declared as a array but used as string and array.

In QueryGenerator::procesData $this->queryConfig can be set to and string instead of an array. This causes cleanUpQueryConfig to fail since indexing into and string will not created an array for the foreach to process.

Actions #1

Updated by Gerrit Code Review over 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51915

Actions #2

Updated by Kasper Ligaard over 7 years ago

  • Priority changed from Should have to Must have
  • Complexity set to no-brainer

This must be a "Must have" since TYPO8 LTS is to support PHP 7.1. Luckily this is also a no-brainer to fix.

Actions #3

Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51915

Actions #4

Updated by Kasper Ligaard over 7 years ago

The reason for this error in PHP 7.1 is only in the case when $queryString is empty:

The empty index operator is not supported for strings anymore
Applying the empty index operator to a string (e.g. $str[] = $x) throws a fatal error instead of converting silently to array.
Ref.: https://secure.php.net/manual/en/migration71.incompatible.php#migration71.incompatible.empty-string-index-operator

Probably more to the point:

...As of PHP 7.1.0, assigning an empty string throws a fatal error. Formerly, it assigned a NULL byte.
Ref.: https://secure.php.net/manual/en/language.types.string.php#language.types.string.substr

Examples of the above for PHP 7.0 and PHP 7.1 respectively:

PHP 7.0:

$ php -a
Interactive shell

php > $a = '';
php > $a[] = 'b';
php >

PHP 7.1:

$ php -a
Interactive shell

php > $a = '';
php > $a[] = 'b';

Warning: Uncaught Error: [] operator not supported for strings in php shell code:1
Stack trace:
#0 {main}
  thrown in php shell code on line 1
php > 
Actions #5

Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51915

Actions #6

Updated by Gerrit Code Review over 7 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51915

Actions #7

Updated by Gerrit Code Review over 7 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51915

Actions #8

Updated by Gerrit Code Review over 7 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51915

Actions #9

Updated by Gerrit Code Review over 7 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51915

Actions #10

Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51944

Actions #11

Updated by Christer V over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF