Item13347: istopic returns TRUE for an empty string
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: IfStatement
Branches: master
%IF{" istopic '' " then="Oh No! Empty String is a Topic. Arrgh!" else="Oh good; istopic works as expected."}%
Where the bug exists, this renders as: Oh No! Empty String is a Topic. Arrgh!
Here it renders as:
Oh good; istopic works as expected.
--
NigelWinterbottom - 02 Apr 2015
Thanks. Fixed in upcoming Foswiki 1.2. See
http://trunk.foswiki.org/Tasks/Item13347 for test.
--
GeorgeClark - 02 Apr 2015
Crawford pointed out that my fix would incorrectly match topic 0000.
But with further testing, topic '0' is also invalid, because normalizeWebTopicName() always returns
WebHome if called with topic = 0, so a topic with that name would probably be unreachable.
--
GeorgeClark - 02 Apr 2015