user-pic

FastSearch encoding issue

Vote 0 Votes

In installs using MySQL 5, I've noticed that when adding double quotes to the search term (as per the instructions: to search for an exact phrase, enclose the phrase in quotes), in the search results the double quotes get encoded to " and display as " rather than ".

As an example: when searching "sample phrase", the result would be:

You searched for... "sample phrase".

Reported on Movable Type 4.2

3 Replies

| Add a Reply
  • Let's try that again without the garbled code:

    In installs using MySQL 5, I've noticed that when adding double quotes to the search term (as per the instructions: to search for an exact phrase, enclose the phrase in quotes), in the search results the double quotes get encoded to " and display as " rather than ". 
    
    

    As an example: when searching "sample phrase", the result would be:

    You searched for… "sample phrase".

  • Damn - third time lucky, perhaps.
    And if the preview worked better we wouldn't have this malarkey.

    In the returned result, instead of "sample phrase", the double quotes are replaced with ampersand+quot+semicolon.

  • In init.fastsearch.php, replacing

    $string = str_replace( '\"', '"', $string );

    with

    $string = str_replace( '\"', '"', $string );

    now returns " rather than " in the results and appears to fix the issue.

    With minimal knowledge of this stuff, I'm assuming this is something to do with things being printed rather than evaluated (and vice-versa).

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1195 3842

Last Topic: Comment form customization by anisa on Feb 8, 2010

60 184

Last Topic: Dynamic Publishing - Blank Screen by Sivaram M on Dec 15, 2009

955 2985

Last Topic: MT5 - Cookie Problems by Dave Cross on Feb 9, 2010

68 213

Last Topic: How to add Custom Fields by gregoryttp on Feb 5, 2010

19 67

Last Topic: Custom main index page by Richard on Feb 7, 2010

42 169

Last Topic: I want to write my own wordpress plugin by Xarzu on Jan 31, 2010

11 21

Last Topic: Monthly Calendars Help Needed by joe leblanc on Jan 19, 2010

91 326

Last Topic: SpamLookup Keyword Filter 2.1 not work by b.n09 on Nov 17, 2009

52 178

Last Topic: Assets - No options by Chelle on Feb 5, 2010

code.sixapart.com

128 444

Last Topic: ActionStream with Movable Type 5.01 by Parneix on Jan 24, 2010

154 468

Last Topic: URGENT! Help needed w/ Virus by PhilContrino on Feb 1, 2010