Search contains title that links to the article
Title is missing in matching search results
Joomla 3.8
PHP 7.0
This is similar to Issues #18432 and #18220 with Pull Requests #18433 and #18221
These are regular expression characters, other regular expressions characters may produce similar results.
Change on Line 161
$needle = str_replace('/', '\/', $needle);
to
$needle = preg_quote($needle,"/");
Status | New | ⇒ | Discussion |
Status | Discussion | ⇒ | Confirmed |
This is usually down to the template since we added color highlighting a few version back the template may need updating.
Please test under protostar.
@tonypartridge Test used Protostar.
3.8.2-dev
Multilanguage Site
macOS Sierra, 10.12.6
Firefox 56 (64-bit)
I had no problem with (test) but i did have a problem with [test]
Status | Confirmed | ⇒ | Discussion |
@brianteeman Did you test with "(test)" or "(test", with both parenthesis the search results will appear as they should, but with only one the title will not appear.
Upon further investigation into the code for the search component and looking at the results with error reporting turned on, in /components/com_search/views/search/view.html.php $needle is not being properly escaped before being put into preg_replace (Line 271). This causes an error to occur when a regular expression character is used that would cause a bad expression, for instance when including just the left parenthesis:
Warning: preg_replace(): Compilation failed: missing ) at offset 10 in [WEBDIR]/components/com_search/views/search/view.html.php on line 270
@brianteeman Did you test with "(test)" or "(test", with both parenthesis the search results will appear as they should, but with only one the title will not appear.
Upon further investigation into the code for the search component and looking at the results with error reporting turned on, in /components/com_search/views/search/view.html.php $needle is not being properly escaped before being put into preg_replace (Line 271). This causes an error to occur when a regular expression character is used that would cause a bad expression, for instance when including just the left parenthesis:
Warning: preg_replace(): Compilation failed: missing ) at offset 10 in [WEBDIR]/components/com_search/views/search/view.html.php on line 270
I’ll take a deeper look
On 7 Nov 2017, 20:03 +0000, DtD Productions notifications@github.com, wrote:
@brianteeman Did you test with "(test)" or "(test", with both parenthesis the search results will appear as they should, but with only one the title will not appear.
Upon further investigation into the code for the search component and looking at the results with error reporting turned on, in /components/com_search/views/search/view.html.php $needle is not being properly escaped before being put into preg_replace (Line 271). This causes an error to occur when a regular expression character is used that would cause a bad expression, for instance when including just the left parenthesis:
Warning: preg_replace(): Compilation failed: missing ) at offset 10 in [WEBDIR]/components/com_search/views/search/view.html.php on line 270
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18478.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
Closed_Date | 2017-11-08 06:01:02 | ⇒ | 2017-11-08 06:01:03 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-11-08 06:01:02 |
Closed_By | ⇒ | franz-wohlkoenig |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/18478
Can't confirm.Search for "(en" as Part of Title "Article (en-gb)" got:Issue confirmed: Tried with given Example Article "This is (Test) [Article]" isn't found.
System information
3.8.2-dev
Multilanguage Site
macOS Sierra, 10.12.6
Firefox 56 (64-bit)
MAMP 4.1.1