Tiny Tiny RSS: Community

Stock search character escape issue

PLEASE READ THIS BEFORE POSTING: Read before posting / reporting bugs

Describe the problem you’re having:
Saw this error message in TT-RSS’ error log while making sure the PDO change was causing no issues, so I investigated it and figured I’d pass it along. Seems pretty benign and ignorable, but I figured I’d pass it along in case it was worthy of note. idk, maybe there’s some PHP escape hijinks possible.

preg_replace(): Unknown modifier ‘h’

  1. classes/feeds.php(561): preg_replace(/(\Q[trim/med]\E)/i, $1[trimmed])
  2. classes/feeds.php(908): format_headlines_list(-4, ForceUpdate, unread, 30, , 0, , score DESC, date_entered, updated, 1, , 1)
  3. backend.php(127): view()

Also, all the results returned by the search had no titles displayed. If you escape the slash yourself, you’ll get results and the entries have titles, but the matched string is not highlighted.

If possible include steps to reproduce the problem:
Use TT-RSS’ search for a string containing slash (/), and actually get results returned by tt-rss. No results, no error.

tt-rss version (including git commit id):
f559d74 - f559d74a4e8dcab529813cb70526dc5762f4a4bf

Also showed up in the error log on a previous commit, I don’t have that exact one. It was pre-PDO, main branch.

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:
Ubuntu 16.04.3, PHP 7.0.22, PostgreSQL 9.5.10
Laugh it up, I’m a bad person. At least I’m not on MySQL anymore.

Please provide any additional information below:
Gonna be honest, I don’t think this matters much, but I don’t know PHP well enough to be certain. I searched the forum for the actual error, got no results, so figured okay, fine, now it’s reported.

yeah, looks like highlighting of search results fails. i thought that \Q … \E would escape everything including slashes but i guess not.

well, good thing it’s purely cosmetic, still a bug though. thanks for reporting.

e: should be fixed by 0f05147531