Bug #56262

Indexed search makes search result Title wrong - htmlspecialchars

Added by Dragan Tomic over 8 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Indexed Search
Target version:
Start date:
2014-02-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Indexed search has error during creation item_title field.

There is an error in SearchController:

in method 'compileSingleResultRow' (line 349) is called 'htmlspecialchars' function ($title field) and then again in 'linkPage' method (line 1186) when returning a tag with the title performing same function again, what makes mess.

Example:
First time performing 'htmlspecialchars' makes from this string Preisverleihung und Preisträger & "2"013 -> Preisverleihung und Preisträger & "2"013 and second performing same method makes this -> Preisverleihung und Preisträger & "2"013 what can't be returned in normal string in FE.

My patch was just to remove line 349 from 'compileSingleResultRow' method:
$title = htmlspecialchars($title);

and it's gonna make nice special character in Title field.

P.S. I attached 2 picture showing search results before and after patch.


Files

Indexed_search_bug_FIX_FORGE.png (9.87 KB) Indexed_search_bug_FIX_FORGE.png Dragan Tomic, 2014-02-25 11:57
Indexed_search_bug_FORGE.png (10.1 KB) Indexed_search_bug_FORGE.png Dragan Tomic, 2014-02-25 12:03
#1

Updated by Dragan Tomic over 8 years ago

Just to format with 'pre' tag (forgot to preview :) ):

Original string *Preisverleihung und Preisträger & "2"013* -> *Preisverleihung und Preisträger & "2"013* (after first performing htmlspecialchars) 
and wrong one *Preisverleihung und Preisträger & "2"013* (after second performing htmlspecialchars on Title field).

#2

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27849

#3

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27849

#4

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27998

#5

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch TYPO3_6-0 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27999

#6

Updated by Markus Klein over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#7

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF