Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN Bug Reports - Other Issues
Author Message
rickallen
New Member
New Member



Joined: Jul 07, 2007
Posts: 10

PostPosted: Tue Nov 13, 2007 9:55 am Reply with quote

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&amp;author=([a-zA-Z0-9]*)&amp;topic=([0-9]*)&amp;min=([0-9]*)&amp;query=([a-zA-Z0-9]*)&amp;type=([a-zA-Z]*)&amp;category=([0-9]*)"',

'"(?<!/)modules.php\?name=Search&amp;author=([a-zA-Z0-9]*)&amp;topic=([0-9]*)&amp;min=([0-9]*)&amp;query=([a-zA-Z0-9]*)&amp;type=([a-zA-Z]*)"',

Changed to,
Code:
'"(?<!/)modules.php\?name=Search&amp;author=([a-zA-Z0-9]*)&amp;topic=([0-9]*)&amp;min=([0-9]*)&amp;query=([a-zA-Z0-9_-\s]*)&amp;type=([a-zA-Z]*)&amp;category=([0-9]*)"',

'"(?<!/)modules.php\?name=Search&amp;author=([a-zA-Z0-9]*)&amp;topic=([0-9]*)&amp;min=([0-9]*)&amp;query=([a-zA-Z0-9_-\s]*)&amp;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
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Nov 13, 2007 4:29 pm Reply with quote

Rick,

Thanks for alerting us to this. We will check it out asap.
 
View user's profile Send private message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Tue Nov 13, 2007 7:02 pm Reply with quote

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! 
View user's profile Send private message Visit poster's website
rickallen







PostPosted: Tue Nov 13, 2007 9:57 pm Reply with quote

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







PostPosted: Wed Nov 14, 2007 8:46 pm Reply with quote

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







PostPosted: Wed Nov 14, 2007 10:05 pm Reply with quote

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







PostPosted: Thu Nov 15, 2007 7:54 pm Reply with quote

No problem. If you find anything else, do not hesitate to let me know either here or in my forums.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN Bug Reports - Other Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©