aboutsummaryrefslogtreecommitdiff
path: root/app/Models/BooleanSearch.php
AgeCommit message (Collapse)Author
2026-01-03Fix unwanted expansion of user queries in some cases (#8395)Gravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/issues/8378
2025-12-23Fix parsing of literal "or" in regex (#8338)Gravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/issues/7879
2025-12-17Rework encoding of search filters (#8324)Gravatar Alexandre Alapetite
Rework: * https://github.com/FreshRSS/FreshRSS/pull/8222 now that we have: * https://github.com/FreshRSS/FreshRSS/pull/8293 Follow-up of: * https://github.com/FreshRSS/FreshRSS/pull/8311 * More simplification * Deprecate getRawInput
2025-12-13Fix search encoding and quoting (#8311)Gravatar Alexandre Alapetite
Revised the encoding approach for searches: the HTML encoding is done just before its use for DB search. Fix also some cases with wrong quoting. Fix https://github.com/FreshRSS/FreshRSS/pull/8306#issuecomment-3643865439 Follow-up of https://github.com/FreshRSS/FreshRSS/pull/8293
2025-12-10Add functions to modify a search expression (#8293)Gravatar Alexandre Alapetite
* Allows easier modifications of the search expression. * Add proper `__toString()` instead of just returning the raw input string. Allows in particular showing the result of the actual parsing of the raw input string in the UI. Needed for https://github.com/FreshRSS/FreshRSS/pull/8294
2025-10-28Mark as read 1 or 7 days based on publication date (#8163)Gravatar Alexandre Alapetite
Allow the UI for marking as read articles older than 1 or 7 days to also work when sorting by publication date (in which case, the publication date is used). <img width="382" height="229" alt="image" src="https://github.com/user-attachments/assets/a630dec8-1e18-4766-8392-59fb593dd73d" />
2025-10-15Implement search form (#8103)Gravatar Alexandre Alapetite
* Add UI for advanced search To help users with the seach operators. Obviously not as powerful as a manually-written search query. Lack in particular negation and logical *and* for now, but I might try to do something about it. <img width="939" height="1438" alt="image" src="https://github.com/user-attachments/assets/0bcad39b-eff3-4f44-876b-a2552af2af00" /> * Consistency: allow multiple user queries like S:1,2 * Fix user query and add tests
2025-01-08Add some missing PHP native types (#7191)Gravatar Alexandre Alapetite
* Add some missing PHP native types Replaces https://github.com/FreshRSS/FreshRSS/pull/7184 * Clean some types
2024-12-27PHPStan 2.0 (#7131)Gravatar Alexandre Alapetite
* PHPStan 2.0 fix https://github.com/FreshRSS/FreshRSS/issues/6989 https://github.com/phpstan/phpstan/releases/tag/2.0.0 https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md * More * More * Done * fix i18n CLI * Restore a PHPStan Next test For work towards PHPStan Level 10 * 4 more on Level 10 * fix getTagsForEntry * API at Level 10 * More Level 10 * Finish Minz at Level 10 * Finish CLI at Level 10 * Finish Controllers at Level 10 * More Level 10 * More * Pass bleedingEdge * Clean PHPStan options and add TODOs * Level 10 for main config * More * Consitency array vs. list * Sanitize themes get_infos * Simplify TagDAO->getTagsForEntries() * Finish reportAnyTypeWideningInVarTag * Prepare checkBenevolentUnionTypes and checkImplicitMixed * Fixes * Refix * Another fix * Casing of __METHOD__ constant
2024-12-05Parentheses in quoted search (#7055)Gravatar Alexandre Alapetite
* Parentheses in quoted search Allow parentheses in quoted search like `author:"Bob (Team1)"` Related to https://github.com/FreshRSS/FreshRSS/pull/7054 * Doc
2024-11-28Upgrade code to php 8.1 (#6748)Gravatar Luc SANCHEZ
* revert Fix code indentation Fix code Upgrade code to php 8.1 * fix remarques * code review * code review * code review * Apply suggestions from code review * code review * Fixes * Many remainging updates of array syntax * Lost case 'reading-list' * Uneeded PHPDoc --------- Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-11-02Fix regex search for tags (#6972)Gravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/6949#issuecomment-2452363378
2024-10-29Fix regex parentheses of referenced search (#6950)Gravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/issues/6949
2024-10-24Fix regex for references to user queries (#6936)Gravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/pull/6926#issuecomment-2432712495
2024-10-22Allow regex parentheses (#6926)Gravatar Alexandre Alapetite
* Allow regex parentheses While waiting for a new better search parser, auto-escape parentheses in regex expressions to allow them like in `/^(ab|cd)/` * Allow escaped parenthesis in regex * A couple more tests
2024-10-02Allow dynamic search operator in user queries (#6851)Gravatar Alexandre Alapetite
* Allow dynamic search operator in user queries fix https://github.com/FreshRSS/FreshRSS/issues/6849 * Other approach
2024-09-20Fix search with double-quote and parenthesis (#6818)Gravatar Alexandre Alapetite
Fix searches like `("test")` with a double-quote preceded by a parenthesis
2024-09-12Fix inversed encoding logic in paramArray (#6800)Gravatar Alexandre Alapetite
* Fix inversed encoding logic in paramArray https://github.com/FreshRSS/FreshRSS/pull/6797#discussion_r1754661634 Also fix the possibility to use `<'&">` in shortcuts, and some minor encoding bugs in user queries * Forgot paramArrayString
2024-08-01Fix parentheses for complex `OR` boolean search expressions (#6672)Gravatar Alexandre Alapetite
* Fix OR parentheses * Pass all tests * Forgotten comment * Minor whitespace * Fix several cases envolving negation * Line length * Fix `OR NOT`
2024-04-23Remove noise parameters in query URL (#6371)Gravatar Alexandre Alapetite
* Remove noise parameters in query URL Remove undeeded `name` and `rid` parameters from saved user query * Fix logic
2024-04-10PHP 8.3 #[\Override] (#6273)Gravatar Alexandre Alapetite
* PHP 8.3 #[\Override] https://php.watch/versions/8.3/override-attr With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors) * Update extension example accordingly
2024-02-26New feature: shareable user query (#6052)Gravatar Alexandre Alapetite
* New feature: shareable user query Share the output of a user query by RSS / HTML / OPML with other people through unique URLs. Replaces the global admin token, which was the only option (but unsafe) to share RSS outputs with other people. Also add a new HTML output for people without an RSS reader. fix https://github.com/FreshRSS/FreshRSS/issues/3066#issuecomment-648977890 fix https://github.com/FreshRSS/FreshRSS/issues/3178#issuecomment-769435504 * Remove unused method * Fix token saving * Implement HTML view * Update i18n for master token * Revert i18n get_favorite * Fix missing i18n for user queries from before this PR * Remove irrelevant tests * Add link to RSS version * Fix getGet * Fix getState * Fix getSearch * Alternative getSearch * Default getOrder * Explicit default state * Fix test * Add OPML sharing * Remove many redundant SQL queries from original implementation of user queries * Fix article tags * Use default user settings * Prepare public search * Fixes * Allow user search on article tags * Implement user search * Revert filter bug * Revert wrong SQL left outer join change * Implement checkboxes * Safe check of OPML * Fix label * Remove RSS button to favour new sharing method That sharing button was using a global admin token * First version of HTTP 304 * Disallow some recusrivity fix https://github.com/FreshRSS/FreshRSS/issues/6086 * Draft of nav * Minor httpConditional * Add support for offset for pagination * Fix offset pagination * Fix explicit order ASC * Add documentation * Help links i18n * Note about deprecated master token * Typo * Doc about format
2023-12-18Pass PHPStan level 8 (#5946)Gravatar Alexandre Alapetite
* Pass PHPStan level 8 And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels * Revert wrong replace in comment * Fix PHPStan level 8 * Update PHPStan and other dev dependencies * Remove obsolete comment * noVariableVariables and towards bleedingEdge https://github.com/phpstan/phpstan-strict-rules https://phpstan.org/blog/what-is-bleeding-edge * More bleedingEdge * A bit more PHPStan level 9 * More PHPStan level 9 * Prepare for booleansInConditions Ignore int and null * Revert wrong line * More fixes * Fix keep_max_n_unread * Stricter attribute functions * Stricter callHooks and more PHPStan level 9 * More typing * A tiny more
2023-11-16Use strict_types (#5830)Gravatar Luc SANCHEZ
* Little's optimisations and booleans in conditions * Apply strict type * Apply strict type * Apply strict type * Fix multiple bugs with PHP 8.2 and 8.3 * Many declares missing, more errors fixed * Apply strict type * Another approach * Stronger typing for Minz_Session * Fix case of SQLite --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-10-30Require PHP 7.4+ (#5720)Gravatar Alexandre Alapetite
* Require PHP 7.4+ https://github.com/FreshRSS/FreshRSS/discussions/5474 * Update Docker oldest Alpine 3.13 with PHP 7.4.26 * Add missing packets to Docker oldest * Update to typed properties https://php.net/migration74.new-features#migration74.new-features.core.typed-properties * More types
2023-09-26Fix search using user queries (#5669)Gravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/issues/5668
2023-09-05Fix parenthesis escaping bug (#5633)Gravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/issues/5632 In the SQL search, parentheses should not be escaped. Escaped parenthesis in the SQL search were tolerated by PostgreSQL but not by SQLite.
2023-07-07Chore/processing of depreciations and updating code to php72 minimum (#5504)Gravatar Luc SANCHEZ
* processing of depreciations and updating of code to php7.2 minimum * Autoformat many strange array indenting And revert a few unwanted changes --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-11A few additional PHPStan rules (#5388)Gravatar Alexandre Alapetite
A subset of https://github.com/phpstan/phpstan-strict-rules
2023-05-07docs: language table added (#5375)Gravatar maTh
* docs: language table added * Update 05_Configuration.md * Update 05_Configuration.md * french docs * Unicode quote and a few fixes (Same search&replace aslo applied to a few other files) --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-04-17Complete PHPStan Level 6 (#5305)Gravatar Alexandre Alapetite
* Complete PHPStan Level 6 Fix https://github.com/FreshRSS/FreshRSS/issues/4112 And initiate PHPStan Level 7 * PHPStan Level 6 for tests * Use phpstan/phpstan-phpunit * Update to PHPStan version 1.10 * Fix mixed bug * Fix mixed return bug * Fix paginator bug * Fix FreshRSS_UserConfiguration * A couple more Minz_Configuration bug fixes * A few trivial PHPStan Level 7 fixes * A few more simple PHPStan Level 7 * More files passing PHPStan Level 7 Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251 * A few more PHPStan Level 7 preparations * A few last details
2023-04-14PHPStan Level 6 FreshRSS_Search FreshRSS_Entry (#5292)Gravatar Alexandre Alapetite
* PHPStan Level 6 FreshRSS_Search FreshRSS_Entry * Minor fix * Type fix * Apply suggestions from code review Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> * Minor types syntax Compatibility Intelephense --------- Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>
2023-03-31PHPStan level 6 for all PDO and Exception classes (#5239)Gravatar Alexandre Alapetite
* PHPStan level 6 for all PDO and Exception classes Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112 * Fix type * Now also our remaining own librairies * Motivation for a few more files * A few more DAO classes * Last interface
2023-01-09Handling of parentheses as special characters in searches (#4989)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/4987
2022-08-16Basic support for negative searches with parentheses (#4503)Gravatar Alexandre Alapetite
* Basic support for negative searches with parentheses * `!((author:Alice intitle:hello) OR (author:Bob intitle:world))` * `(author:Alice intitle:hello) !(author:Bob intitle:world)` * `!(S:1 OR S:2)` * Minor documentation / comment * Remove syslog debug line
2022-06-19Update all test dependencies (#4419)Gravatar Alexandre Alapetite
* Update all test dependencies * Remove old false-positive * Minor update lock files * Increase PHPStan memory for Fedora https://github.com/FreshRSS/FreshRSS/pull/4400#issuecomment-1159514197 * Require PHP8+ for tests Due to small changes of signature in `ob_implicit_flush` and `simplexml_load_string`, cf. https://github.com/FreshRSS/FreshRSS/pull/4123 * Missing lint in CSS files
2022-06-02New search engine (#4378)Gravatar Alexandre Alapetite
* New possibility to invoke user queries from a search expression From the search field: `S:"My query"`. Can be combined with other filters such as `S:"My query" date:P3d` as long as the user queries do not contain `OR`. A use-case is to have an RSS filter with a stable address or an external API call with the ability to update the user query. * Draft of parenthesis logic * More draft * Working parenthesis (a OR b) (c OR d) * Working (A) OR (B) * Support nested parentheses + unit tests + documentation * search:MySearch and S:3
2022-05-12OPML export/import of some proprietary FreshRSS attributes (#4342)Gravatar Alexandre Alapetite
* OPML export/import of some proprietary FreshRSS attributes #fix https://github.com/FreshRSS/FreshRSS/issues/4077 And one of the TODOs of https://github.com/FreshRSS/FreshRSS/pull/4220 XPath options, CSS Selector, and action filters * Bump library patch version * OPML namespace + documentation * Add example
2022-03-21Fix some search expressions (#4277)Gravatar Alexandre Alapetite
* Fix some search expressions * Fix decoding bug when using quotes to search free text containing some spaces such as `"ab cd"` * Fix use of `-` wrongly triggering a negative search in e.g. `ab-cd` * Fix edge cases * A couple of tests
2018-11-11Tweaks for Vienna RSS (#2093)Gravatar Alexandre Alapetite
* Tweaks for Vienna RSS https://github.com/FreshRSS/FreshRSS/issues/2091 https://github.com/ViennaRSS/vienna-rss/issues/1197 * Fix get feed by URL * Fix get item ids returning starred elements * API add item ids by feed URL * Add API filter `it` https://feedhq.readthedocs.io/en/latest/api/reference.html#stream-items-ids * API add `nt=` filter + refactoring * No ; prefix for author https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435562495 * Add id long form prefix and accept short id form https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435631259 * Fix quote problem https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435683930 * Isolate bug fix for News+ https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435687041 * Rework encoding conventions https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-437441834 * Unicode escaping alternative Alternative approach to encode XML special characters and other problematic characters into their Unicode fullwidth version when we cannot use HTML-encoding because clients disagree wether they should HTML-decode or not. https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-436059559
2018-03-14Light Boolean search implementation (#1828)Gravatar Alexandre Alapetite
* Light Boolean search implementation "Hello intitle:World OR date:P1D example" https://github.com/FreshRSS/FreshRSS/issues/879 * Doc Boolean search * Doc typos