Skip to content

Commit

Permalink
!!![BUGFIX] Exception with tx_solr_statistics after latest TYPO3 secu…
Browse files Browse the repository at this point in the history
…rity update

**Note:** This change requires the database schema update.

With the Security update at November, 14th 2023 the cookie generation changed in the TYPO3 core.

This leads to an exception, when executing the search and statistics are enabled.

Reason is, that the generated cookies are longer than the old ones and do not fit in the tx_solr_statistics.cookie any more. The available length is 32 chars, TYPO3 core allows up to 190.

This change increases the length of `tx_solr_statistics.cookie` field to 255 characters. Beside of that, the deprecated method to fetch the fe_user cookie value is adjusted to new TYPO3 API.

Fixes: #3877
  • Loading branch information
dkd-kaehm committed Nov 15, 2023
1 parent 99549d9 commit 46c1a33
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
Expand Up @@ -97,7 +97,7 @@ public function process(SearchResultSet $resultSet): SearchResultSet
// @extensionScannerIgnoreLine
'time_processing' => $response->debug->timing->process->time ?? 0,
'feuser_id' => isset($TSFE->fe_user->user) ? (int)$TSFE->fe_user->user['uid'] ?? 0 : 0,
'cookie' => $TSFE->fe_user->id ?? '',
'cookie' => $TSFE->fe_user->getSession()->getIdentifier() ?? '',
'ip' => IpAnonymizationUtility::anonymizeIp($this->getUserIp(), $ipMaskLength),
'page' => $page,
'keywords' => $keywords,
Expand Down
16 changes: 12 additions & 4 deletions Documentation/Releases/solr-release-11-5.rst
Expand Up @@ -6,14 +6,22 @@
Releases 11.5
=============

.. include:: HintAboutOutdatedChangelog.rst.txt

Release 11.5.4
Release 11.5.5
--------------

This is a maintenance release for TYPO3 11.5 and the last release that supports Apache Solr 8.11. Next EXT:solr release for TYPO3 11.5 will be 11.6.0, it
This is a maintenance release for TYPO3 11.5 and the last release that supports Apache Solr 8.11.
Next EXT:solr release for TYPO3 11.5 will be 11.6.0, it
will contain support for Apache Solr 9 and some breaking improvements.

**Note:** This change requires the database schema update, due of database schema change from `pull-request #3880 <https://github.com/TYPO3-Solr/ext-solr/pull/3880>`__

11.5.5 contains the following changes:

- !!![BUGFIX:11.5] Exception with tx_solr_statistics after latest TYPO3 security update by @dkd-kaehm in `#3880 <https://github.com/TYPO3-Solr/ext-solr/pull/3880>`__

Release 11.5.4
--------------

11.5.4 contains the following changes:

- [TASK] Fix CI 2023.09.11 on release-11.5.x by @dkd-kaehm in `#3777 <https://github.com/TYPO3-Solr/ext-solr/pull/3777>`__
Expand Down
Expand Up @@ -25,6 +25,7 @@
use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration;
use ApacheSolrForTypo3\Solr\Tests\Unit\UnitTest;
use PHPUnit\Framework\MockObject\MockObject;
use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;

/**
Expand Down Expand Up @@ -83,6 +84,7 @@ public function canWriteExpectedStatisticsData()
{
/* @var TypoScriptFrontendController $fakeTSFE */
$fakeTSFE = $this->getDumbMock(TypoScriptFrontendController::class);
$fakeTSFE->fe_user = $this->getDumbMock(FrontendUserAuthentication::class);
$fakeTSFE->id = 888;
$fakeTime = 100;
$fakeIP = '192.168.2.22';
Expand Down
2 changes: 1 addition & 1 deletion ext_tables.sql
Expand Up @@ -27,7 +27,7 @@ CREATE TABLE tx_solr_statistics (
time_processing int(11) DEFAULT '0' NOT NULL,

feuser_id int(11) unsigned DEFAULT '0' NOT NULL,
cookie varchar(32) DEFAULT '' NOT NULL,
cookie varchar(255) DEFAULT '' NOT NULL,
ip varchar(255) DEFAULT '' NOT NULL,

keywords varchar(128) DEFAULT '' NOT NULL,
Expand Down

0 comments on commit 46c1a33

Please sign in to comment.