YAFLogo

BonzoFestoon
7 years ago
Why does this link work:

http://yetanotherforum.net/forum/search?search=test 

But this one does not?

http://yetanotherforum.net/forum/search?search=test+error 

If someone could please point me in the direction to look in the source.

We recent did a mass clean up of posts in our forum (deleted about 3500 posts). However, there are were a good number of the posts indexed on the search engines. Instead of going to the login page, I modified the forum to generate some search words from the slug after the topic or message id. It works great except for when the slug has the word "error" in it.

in posts.ascx.cs > page_load event, I am doing something like this:


// in case topic is deleted or not existent
if (_topic == null || PageContext.PageTopicID == 0)
{
    //YafBuildLink.RedirectInfoPage(InfoMessage.TopicDeleted); // better than before, but not good enuf
    var url = General.GetSafeRawUrl();
    var topic = RemoveStopwords(url);
    YafBuildLink.Redirect(ForumPages.search, "search={0}", topic);
}

For now, I am filtering the words "error" and "errors".

There is no problem if the user enters the word "error" in the search box, but if the word "error" is in the search query string param, it seems to lose its mind. Any help would be appreciated.

P.S. The word "installation" also seems to break it. I really need to find the code that is causing this so I can cover all cases. Thanks!

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
7 years ago
This issue is caused by the urlrewriter config. Only the two words error and install cause this problem. I commited the changes to fix the issue. you can apply the canges to your config file via 0e3c9b3d163ce97179628318cc30d8366a9f6a2f 
BonzoFestoon
7 years ago
Ha! Thanks for the fix! It was driving me crazy! What are the odds I would find those two words within 5 minutes? I need to go and play the lottery!

Fix is confirmed on my site. Thanks again!