Author |
Message |
rickallen
New Member


Joined: Jul 07, 2007
Posts: 10
|
Posted:
Tue Nov 13, 2007 9:55 am |
|
I searched the forum for a fix for this, but did not find one. So please excuse me if this has already been addressed.
Searching two words with the search form that have a space between them (mad dog) results in a broken link for "Next Results".
I fixed this problem by editing the GT-Search.php short links file and the .htaccess file to to allow the space character. I also added the hyphen and underscore while I was in there.
Originally,
Code:'"(?<!/)modules.php\?name=Search&author=([a-zA-Z0-9]*)&topic=([0-9]*)&min=([0-9]*)&query=([a-zA-Z0-9]*)&type=([a-zA-Z]*)&category=([0-9]*)"',
'"(?<!/)modules.php\?name=Search&author=([a-zA-Z0-9]*)&topic=([0-9]*)&min=([0-9]*)&query=([a-zA-Z0-9]*)&type=([a-zA-Z]*)"',
|
Changed to,
Code:'"(?<!/)modules.php\?name=Search&author=([a-zA-Z0-9]*)&topic=([0-9]*)&min=([0-9]*)&query=([a-zA-Z0-9_-\s]*)&type=([a-zA-Z]*)&category=([0-9]*)"',
'"(?<!/)modules.php\?name=Search&author=([a-zA-Z0-9]*)&topic=([0-9]*)&min=([0-9]*)&query=([a-zA-Z0-9_-\s]*)&type=([a-zA-Z]*)"',
|
I also had to make the same change in the .htaccess file like this:
Code:RewriteRule ^search-([a-zA-Z0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([a-zA-Z]*)-([0-9]*).html modules.php?name=Search&author=$1&topic=$2&min=$3&query=$4&type=$5&category=$6 [L]
RewriteRule ^search-([a-zA-Z0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z0-9]*)-([a-zA-Z]*).html modules.php?name=Search&author=$1&topic=$2&min=$3&query=$4&type=$5 [L]
|
Changed to,
Code:RewriteRule ^search-([a-zA-Z0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z0-9_-\s]*)-([a-zA-Z]*)-([0-9]*).html modules.php?name=Search&author=$1&topic=$2&min=$3&query=$4&type=$5&category=$6 [L]
RewriteRule ^search-([a-zA-Z0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z0-9_-\s]*)-([a-zA-Z]*).html modules.php?name=Search&author=$1&topic=$2&min=$3&query=$4&type=$5 [L]
|
After the change the next and previous links at the bottom of the search results are now working for two words separated by a space, hyphen or underscore.
Since the search query term is passed in the url maybe other forms of punctuation should be included if this is not a security risk.
Again, sorry if this has already been addressed in the upcoming release. This was on a clean install of 2.10.01.
Rick |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Nov 13, 2007 4:29 pm |
|
Rick,
Thanks for alerting us to this. We will check it out asap. |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Tue Nov 13, 2007 7:02 pm |
|
Personally, I had changed my Downloads search to use POST instead of GET, which would also work here. I HATE how FB put the search words in the URL. It just makes NO sense.
But, in the 2 - 3 years that I have been using this and supporting it the last two years, this is the first "complaint" raised about this. So, hopefully this, and other punctuation, will not be a big problem.
I'll look into this for our upcoming 2.20.00 release of RavenNuke... |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
rickallen

|
Posted:
Tue Nov 13, 2007 9:57 pm |
|
Actually the search function is my editor's biggest beef with "nuke" sites. He expects the thing to work like Google. I really can't use Google search because it would pull a lot of unrelated content from the site since I have a few projects all being fed from the same domain. I may go to some other type of search script outside of the search module anyway. He is mainly looking for relavance based results. Any ideas would be welcome.
Just thought I should bring this up since it was causing some weirdness.
I really appreciate what the Raven team is doing here. Before I insalled this script I was getting hacked every week with an old patched version of Nuke. Now about 20 sql injectons are getting blocked a day. Awesome!
montego wrote: | Personally, I had changed my Downloads search to use POST instead of GET, which would also work here. I HATE how FB put the search words in the URL. It just makes NO sense.
But, in the 2 - 3 years that I have been using this and supporting it the last two years, this is the first "complaint" raised about this. So, hopefully this, and other punctuation, will not be a big problem.
I'll look into this for our upcoming 2.20.00 release of RavenNuke... |
|
|
|
|
 |
montego

|
Posted:
Wed Nov 14, 2007 8:46 pm |
|
BTW, I opened up the query parameters to match some of the others for other modules:
query=([/:\-\'{}()\,\._&a-zA-Z0-9+= ]*)
Notice the space at the end. The corresponding .htaccess is:
([/:\-\'{}()\,\._&a-zA-Z0-9+=\ ]*)
Note that the space must be "escaped".
I tried using [:punct:][:alnum:], but it ended up being too aggressive. I may tweak this some in coming versions....
BTW, also found that you have to also fix some query= rules in encyclopedia, downloads and web links. |
|
|
|
 |
rickallen

|
Posted:
Wed Nov 14, 2007 10:05 pm |
|
montego wrote: | BTW, I opened up the query parameters to match some of the others for other modules:
query=([/:\-\'{}()\,\._&a-zA-Z0-9+= ]*)
Notice the space at the end. The corresponding .htaccess is:
([/:\-\'{}()\,\._&a-zA-Z0-9+=\ ]*)
Note that the space must be "escaped".
I tried using [:punct:][:alnum:], but it ended up being too aggressive. I may tweak this some in coming versions....
BTW, also found that you have to also fix some query= rules in encyclopedia, downloads and web links. |
Ouch on the encyclopedia and downloads. I'll check those out too. I really don't use downloads or the encyclopedia but I never know. Better to have them fixed and ready.
Thanks for checking this out and coming up with a better solution.
Rick |
|
|
|
 |
montego

|
Posted:
Thu Nov 15, 2007 7:54 pm |
|
No problem. If you find anything else, do not hesitate to let me know either here or in my forums. |
|
|
|
 |
|