TYPO3GmbH / blog

This blog extension uses TYPO3s core concepts and elements to provide a full-blown blog that users of TYPO3 can instantly understand and use.
https://typo3.com
GNU General Public License v2.0
42 stars 54 forks source link

explode() - string required, int passed #301

Open NamelessCoder opened 8 months ago

NamelessCoder commented 8 months ago

Bug Report

Prerequisites

Description

GeneralUtility::intExplode is called from CategoryRepository with $this->settings['persistence']['storagePid'] as argument, but this value is an integer on TYPO3v12 due to the new TS parser. On PHP 8.x this causes an error because explode() no longer silently accepts integers as input.

Also happens in:

Steps to Reproduce

  1. Install the extension
  2. Insert the "list" plugin on a page
  3. Load the page in FE

Expected behavior: Obviously, no exceptions thrown.

Actual behavior: Exception thrown.

Versions

  - Locking t3g/blog (12.0.2)

image

DavidBruchmann commented 6 months ago

I just patched the GeneralUtility for it:

- $result = explode($delimiter, $string);
+ $result = explode($delimiter, (string) $string);
mbrodala commented 4 months ago

Just proposed a PR with exactly this fix.