You are here: Foswiki>Tasks Web>Item13347 (05 Jul 2015, GeorgeClark)Edit Attach

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
Reported By: NigelWinterbottom
Waiting For:
Last Change By: GeorgeClark
%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 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
Topic revision: r4 - 05 Jul 2015, GeorgeClark - This page was cached on 23 Oct 2021 - 09:53.

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