Skip to content

Commit f0774f1

Browse files
committed
refactor: improved query
1 parent 4874aba commit f0774f1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

phpmyfaq/src/phpMyFAQ/Sitemap.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
declare(strict_types=1);
1+
<?php declare(strict_types=1);
42

53
/**
64
* The main Sitemap class.
@@ -195,7 +193,7 @@ public function getFaqsFromLetter(string $letter = 'A'): array
195193
WHERE
196194
fd.id = fcr.record_id
197195
AND
198-
%s(fd.thema, 1, 1) = '%s'
196+
fd.thema LIKE '%s%%'
199197
AND
200198
fd.lang = '%s'
201199
AND
@@ -206,7 +204,6 @@ public function getFaqsFromLetter(string $letter = 'A'): array
206204
Database::getTablePrefix(),
207205
Database::getTablePrefix(),
208206
Database::getTablePrefix(),
209-
$this->configuration->getDb() instanceof Sqlite3 ? 'SUBSTR' : 'SUBSTRING',
210207
$this->configuration->getDb()->escape($letter),
211208
$this->configuration->getLanguage()->getLanguage(),
212209
$permPart,

0 commit comments

Comments
 (0)