Item10491: Search corrupted if substring matches larger string ending in .txt

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.3
Target Release: patch
Applies To: Engine
Component: SEARCH
Branches:
Reported By: GeorgeClark
Waiting For:
Last Change By: KennethLavrsen
Search on Foswiki.org has been showing some signs of corruption. The topic Tasks/Item968 appeared to be related, however it can be created From IRC:

SomeString.txt

So hopefully this topic will cause the same issue once I save it...

-- GeorgeClark - 15 Mar 2011

The WikiWord is being expanded in the first hit of the search results. 2nd and subsequent hits don't get corrupted.

<div class="foswikiSearchResult"><div class="foswikiTopRow">
<a href="/Item10491/txt: <span class="foswikiNewLink">SomeString<a href="/bin/edit/System/SomeString?topicparent=System.WebSearch" rel="nofollow" title="Create this topic">?</a></span> "><b>txt: <span class="foswikiNewLink">SomeString<a href="/bin/edit/System/SomeString?topicparent=System.WebSearch" rel="nofollow" title="Create this topic">?</a></span> </b></a>
<div class="foswikiSummary"></div></div>

And worse, the string is then interpreted as if it were a web. See the following search results: Reports 2 webs: Results from Tasks web, and Results from Item10491 web

http://foswiki.org/System/WebSearch?tab=searchadvanced&search=SomeString&scope=all&order=topic&type=word&limit=;web=Tasks

-- GeorgeClark - 15 Mar 2011

Sample search
%SEARCH{"SomeString" web="Tasks"  scope="text" order="topic" type="word" }%

Searched: SomeString

Results from Tasks web retrieved at 15:04 (GMT)

Item10491
it can be created From IRC: SomeString.txt So hopefully this topic hits don't get corrupted. SomeString? " txt: SomeString? And ?tab=searchadvanced search=SomeString scope=all order=topic type=
Number of topics: 1

-- GeorgeClark - 15 Mar 2011

This might be related to Trunk issue Item10479 in that the searches that exhibit corruption on Release11 cause the crash on Trunk. There were some patches applied to Foswiki.org by PaulHarvey that I've removed. But that did not improve the issue.

I'm able to duplicate the issue locally on a 1.1.3 checkout (two webs returned with a single web search). However the same search macro run from the Unit Test framework only returns a single web, so unable to reproduce for a unit test.

-- GeorgeClark - 15 Mar 2011

gosh how non-trivial - its text and Forking specific.

and it turns out that a greedy match on a 'string ending in .txt' will give us a bad result if we craft a topic in just the right way...

-- SvenDowideit - 16 Mar 2011

 

ItemTemplate edit

Summary Search corrupted if substring matches larger string ending in .txt
ReportedBy GeorgeClark
Codebase 1.1.3 beta1
SVN Range
AppliesTo Engine
Component SEARCH
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:96d5cd459dce distro:56f1feb3b041 distro:cc348ac60bf3 distro:81af17669067
TargetRelease patch
ReleasedIn 1.1.3
Topic revision: r8 - 16 Apr 2011, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy