Tags:
create new tag
view all tags

Question

I found a crash using TWiki. At first, TWiki crashed only for some users .... Yes, I was detecting if user are logged or not just testing %USERNAME% against %WIKINAME (I am using APACHE + LDAP), using IF, but in fact, the crash has nothing to do with this, just amazing .

Well, twiki.org crash also, so it iseasy to make understand : see VarIFcrashTWiki

What is the problem :

%IF{"%USERNAME% = %WIKINAME%" then="YES" else="NO"}%

if %WIKINAME% (or any other VAR or string starts with And), TWiki will crash, case of all Andreas wiki users here wink

It is possible to avoid this problem simply adding '' around vars :

%IF{"'%USERNAME%' = '%WIKINAME%'" then="YES" else="NO"}%

So, something like :

   * Set A = someText
   * Set B = AndSomeText

%IF{"'%A%' = '%B%'" then="YES" else="NO"}%

will crash TWiki too if your remove the '' chars.

Environment

TWiki.org is ok ...

TWiki version: TWiki 4.0
TWiki plugins:  
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories:  

-- PatrickNomblot - 07 Jul 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Thanks for reporting. Bugs:Item2607 filed.

-- PeterThoeny - 07 Jul 2006

The easy workaround would be to write

%IF{"$ USERNAME = $ WIKINAME" then="YES" else="NO"}%
(as seen in the examples IfStatements). Just in case you don't want to wait for the fix smile

-- HaraldJoerg - 07 Jul 2006

Adding '' is also a nice solution as I describe it. The idea is in fact simply to enhance TWiki stability against topic contents.

-- PatrickNomblot - 04 Aug 2006

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2006-08-04 - PatrickNomblot
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.