Skip to content

Commit cec1cd7

Browse files
committed
[BUGFIX] Add missing quote
1 parent 00a82b5 commit cec1cd7

8 files changed

Lines changed: 63 additions & 7 deletions

File tree

Classes/Controller/NewsController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected function createDemandObjectFromSettings(
112112

113113
/* @var $demand NewsDemand */
114114
$demand = GeneralUtility::makeInstance($class, $settings);
115-
if (!$demand instanceof NewsDemand) {
115+
if (!is_a($class, NewsDemand::class, true)) {
116116
throw new \UnexpectedValueException(
117117
sprintf(
118118
'The demand object must be an instance of %s, but %s given!',
@@ -122,6 +122,8 @@ protected function createDemandObjectFromSettings(
122122
1423157953
123123
);
124124
}
125+
/* @var $demand NewsDemand */
126+
$demand = GeneralUtility::makeInstance($class, $settings);
125127

126128
$demand->setCategories(GeneralUtility::trimExplode(',', $settings['categories'] ?? '', true));
127129
$demand->setCategoryConjunction((string)($settings['categoryConjunction'] ?? ''));

Classes/Domain/Repository/AbstractDemandedRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ public function findDemandedRaw(DemandInterface $demand, $respectEnableFields =
8989

9090
$queryBuilder = $queryParser->convertQueryToDoctrineQueryBuilder($query);
9191
$queryParameters = $queryBuilder->getParameters();
92+
$connection = $queryBuilder->getConnection();
9293
$params = [];
9394
foreach ($queryParameters as $key => $value) {
9495
// prefix array keys with ':'
95-
$params[':' . $key] = "'" . $value . "'";
96+
$params[':' . $key] = $connection->quote($value);
9697
unset($params[$key]);
9798
}
9899
// replace placeholders with real values

Classes/Domain/Repository/NewsRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ public function findByUid($uid, $respectEnableFields = true): ?News
353353
*/
354354
public function countByDate(DemandInterface $demand): array
355355
{
356+
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
357+
->getConnectionForTable('tx_news_domain_model_news');
356358
$data = [];
357359
$sql = $this->findDemandedRaw($demand);
358360

@@ -361,10 +363,8 @@ public function countByDate(DemandInterface $demand): array
361363

362364
// Get the month/year into the result
363365
$field = $demand->getDateField();
364-
$field = empty($field) ? 'datetime' : $field;
366+
$field = $connection->quoteIdentifier(empty($field) ? 'datetime' : $field);
365367

366-
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
367-
->getConnectionForTable('tx_news_domain_model_news');
368368
$isPostgres = $connection->getDatabasePlatform() instanceof PostgreSQLPlatform;
369369
$isSqlite = $connection->getDatabasePlatform() instanceof SQLitePlatform;
370370
if ($isPostgres) {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
12.3.2 - 18th May 2026
2+
======================
3+
4+
Regular release, please read the following notes carefully.
5+
6+
.. contents::
7+
:local:
8+
:depth: 3
9+
10+
11+
All Changes
12+
-----------
13+
This is a list of all changes in this release: ::
14+
15+
2026-05-18 [BUGFIX] Add missing quote
16+
17+
This list has been created by using `git log $(git describe --tags --abbrev=0)..HEAD --abbrev-commit --pretty='%ad %s (Commit %h by %an)' --date=short`.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
13.0.2 - 18th May 2026
2+
======================
3+
4+
Regular release, please read the following notes carefully.
5+
6+
.. contents::
7+
:local:
8+
:depth: 3
9+
10+
11+
All Changes
12+
-----------
13+
This is a list of all changes in this release: ::
14+
15+
2026-05-18 [BUGFIX] Add missing quote
16+
17+
This list has been created by using `git log $(git describe --tags --abbrev=0)..HEAD --abbrev-commit --pretty='%ad %s (Commit %h by %an)' --date=short`.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
14.0.3 - 18th May 2026
2+
======================
3+
4+
Regular release, please read the following notes carefully.
5+
6+
.. contents::
7+
:local:
8+
:depth: 3
9+
10+
11+
All Changes
12+
-----------
13+
This is a list of all changes in this release: ::
14+
15+
2026-05-18 [BUGFIX] Add missing quote
16+
17+
This list has been created by using `git log $(git describe --tags --abbrev=0)..HEAD --abbrev-commit --pretty='%ad %s (Commit %h by %an)' --date=short`.

Documentation/Misc/Changelog/Index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ List of versions
1717
:titlesonly:
1818
:glob:
1919

20-
20+
14-0-3
2121
14-0-2
2222
14-0-1
2323
14-0-0
24+
13-0-2
2425
13-0-1
2526
13-0-0
27+
12-3-2
2628
12-3-1
2729
12-3-0
2830
12-2-0

ext_emconf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
'author' => 'Georg Ringer',
88
'author_email' => 'mail@ringer.it',
99
'state' => 'stable',
10-
'version' => '14.0.2',
10+
'version' => '14.0.3',
1111
'constraints' => [
1212
'depends' => [
1313
'php' => '8.2.0-8.5.99',

0 commit comments

Comments
 (0)