Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Watch for formatting changes when searching hints Site News

Be careful when searching for a hint, especially if you use more than one search term. If the returned hint contains code, it may not display correctly. Open the following URL's in separate tabs. The first is the original hint. The second is how the hint appeared as the result of a search (on "encrypted disk image").

Original hint

Search results URL

The correct shell script code as it appeared in the original hint is:

#!/bin/csh -f
/usr/bin/hdid "$1"
if ($status != 0) exit
/usr/bin/open -a "Mail"
The incorrect code that appeared in the searched for hint is:

#!/bin/csh -f
/usr/bin/hdid \"$1\"
if ($status != 0) exit
/usr/bin/open -a \"Mail\"

If you were to copy and paste the incorrect code, as I did, you might spend days, as I did, figuring out how to make it work and wondering why the author of the hint submitted incorrect code in the first place.

[robg adds: There are some known issues with the search engine in Geeklog, and this is one of them. In the above example, after I run a search, I edit the URL and remove the part that starts with &query=... and then hit Enter to load the "original" version of the hint. In addition, if you search for spaces, backslashes, ticks, etc., you'll get SQL errors. I have hired out fixes for these glitches, along with search engine enhancements, to a third party, and I expect to have a revised search function in place within a few weeks.]
  • Currently 1.20 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)

Watch for formatting changes when searching hints | 2 comments | Create New Account
Click here to return to the 'Watch for formatting changes when searching hints' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Watch for formatting changes when searching hints
Authored by: Spartacus on Jul 15, '03 11:12:28AM

It would be nice to have the article's permalink somewhere in the heading, e.g. on the date. I figured out how to strip the query parameter before bookmarking a hint, but simply clicking the permalink would be more convenient.

[ Reply to This | # ]
Watch for formatting changes when searching hints
Authored by: wyvern on Jul 15, '03 02:49:22PM

Easy fix:
It looks like you can just run stripslashes() on the affected code, since it would appear that what's being escaped out are the characters that SQL wants escaped. In other words, the slashes added by addslashes().

[ Reply to This | # ]