PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Author Message
rickallen
New Member
New Member


Joined: Jul 07, 2007
Posts: 10

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

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: 16987
Location: Kansas

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

Rick,

Thanks for alerting us to this. We will check it out asap.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
montego
Site Admin


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

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

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


Joined: Jul 07, 2007
Posts: 10

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

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...
View user's profile Send private message
montego
Site Admin


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

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

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


Joined: Jul 07, 2007
Posts: 10

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

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
View user's profile Send private message
montego
Site Admin


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

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

No problem. If you find anything else, do not hesitate to let me know either here or in my forums.
View user's profile Send private message Visit poster's website
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.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum