mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-23 03:34:41 -04:00
Improve search: intitle, author, inurl
Allow multiple values of intitle: , author:, inurl: Note: Tests for UserQueryTest are broken due to https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.0.0#backwards-compatibility-issues
This commit is contained in:
1 parent
f98cd52a02
commit
d9c0d25b85
7 files changed
+134
-112
No files matched your search
+13
-8
@@ -631,16 +631,22 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
|
||||
}
|
||||
if ($filter) {
|
||||
if ($filter->getIntitle()) {
|
||||
$search .= 'AND ' . $alias . 'title LIKE ? ';
|
||||
$values[] = "%{$filter->getIntitle()}%";
|
||||
foreach ($filter->getIntitle() as $title) {
|
||||
$search .= 'AND ' . $alias . 'title LIKE ? ';
|
||||
$values[] = "%{$title}%";
|
||||
}
|
||||
}
|
||||
if ($filter->getInurl()) {
|
||||
$search .= 'AND CONCAT(' . $alias . 'link, ' . $alias . 'guid) LIKE ? ';
|
||||
$values[] = "%{$filter->getInurl()}%";
|
||||
foreach ($filter->getInurl() as $url) {
|
||||
$search .= 'AND CONCAT(' . $alias . 'link, ' . $alias . 'guid) LIKE ? ';
|
||||
$values[] = "%{$url}%";
|
||||
}
|
||||
}
|
||||
if ($filter->getAuthor()) {
|
||||
$search .= 'AND ' . $alias . 'author LIKE ? ';
|
||||
$values[] = "%{$filter->getAuthor()}%";
|
||||
foreach ($filter->getAuthor() as $author) {
|
||||
$search .= 'AND ' . $alias . 'author LIKE ? ';
|
||||
$values[] = "%{$author}%";
|
||||
}
|
||||
}
|
||||
if ($filter->getMinDate()) {
|
||||
$search .= 'AND ' . $alias . 'id >= ? ';
|
||||
@@ -659,8 +665,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable {
|
||||
$values[] = $filter->getMaxPubdate();
|
||||
}
|
||||
if ($filter->getTags()) {
|
||||
$tags = $filter->getTags();
|
||||
foreach ($tags as $tag) {
|
||||
foreach ($filter->getTags() as $tag) {
|
||||
$search .= 'AND ' . $alias . 'tags LIKE ? ';
|
||||
$values[] = "%{$tag}%";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user