tricolibraries / mobilecat

Automatically exported from code.google.com/p/mobilecat
GNU General Public License v3.0
0 stars 0 forks source link

No results displayed by search.php when special characters present #29

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Search results do not display when search results contain special characters 
that are not UTF8 encoded. This occurs only with search.php; search_nojs.php 
returns results but special characters are garbled. Testing shows errors 
occurring when these are present in the Title or Author; probably will break on 
any string with special characters.

When the page errors, a fully-loaded search results section is displayed with 
the typical "233 results for Albert" text but without any results loaded. In 
this circumstance, browse.php returns successfully but search.js silently 
breaks when trying to pass those results through jquery.

A simple utf8_encode() will solve this, though I don't recall running into this 
on my production server running Fedora. Should play it safe and make sure 
everything is the proper encoding and safe to pass between our services.

* Tested with Mobilecat 1.1, on Ubuntu Server 10.4 LTS targetting 
albert.stmarys-ca.edu

Original issue reported on code.google.com by dmh4%stm...@gtempaccount.com on 24 May 2011 at 3:22

GoogleCodeExporter commented 9 years ago
We're having this trouble as well. It could be that our data has more special 
characters that others, but it comes up quite frequently. Frequently enough 
that we haven't rolled MobileCat out to our libraries. I would call this  High 
priority issue personally.

I'm all for a proper fix, but can you give me an idea where the utf8_encode() 
would go?

Original comment by hopkin...@gmail.com on 9 Dec 2011 at 5:57

GoogleCodeExporter commented 9 years ago
For the time being I've modified the Smarty template for the search results 
page to escape the title, author, etc. This isn't a very good fix because it 
just throws away the content of the offending string - the entire string. But 
it does give me the search results ;) Attached is a patch for your amusement.

Original comment by hopkin...@gmail.com on 9 Dec 2011 at 7:58

Attachments: