Tags:
create new tag
view all tags

Question

When forcing a link to be named 0, the url of the link is displayed instead of 0.

Example :

[[https://twiki.org][0]]

is shown in TWikiRelease04x00x04 as :

I have found a workaround : adding a space before 0:

[[https://twiki.org][ 0]]

which give me the wanted result :

The problem is only occuring with 0 (The numbers 1 and greater don't need to be prefixed by a space)

The problem is not occuring at all on the Cairo release (01 Sep 2004)

Given that I have a workaround, the bug introduced have a very low impact on our installation (There may be around 5 links like that).

Environment

TWiki version: TWikiRelease04x00x04
TWiki plugins: SpreadSheetPlugin, BeautifierPlugin, ChartPlugin, CommentPlugin, CompareRevisionsAddonPlugin, DirectedGraphPlugin, EditTablePlugin, GaugePlugin, InterwikiPlugin, PreferencesPlugin, RenderListPlugin, RevCommentPlugin, SlideShowPlugin, SmiliesPlugin, TablePlugin
Server OS: Redhat 9.0, kernel 2.4.20-8
Web server: Apache 2.0.52
Perl version: 5.8.0
Client OS: MS Windows XP, service pack 2
Web Browser: Internet Explorer 6, Firefox 1.5.0.4
Categories:  

-- GuillaumeNobiron - 19 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.

Sounds like some Perl devilry. This should be posted on Bugs

-- FranzJosefSilli - 01 Aug 2006

Found TWikibug:Item5471 which shows similar effect in totally different context. 0 seems to be somehow problematic.

-- FranzJosefGigler - 14 Apr 2008

This is a typical Perl coding issue:

if( $something ) { do it; }

In above example, if $something has value 0, Perl considers it as 'false'. As a programmer you need to distinguish between string (compare to an empty value) and a number (compare to zero). If you look at a string value you can do this test (there are other tests too):

if( $something != '' ) { do it; }

-- PeterThoeny - 14 Apr 2008

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2020-04-26 - PeterThoeny
 
  • 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.