Tags:
create new tag
view all tags

Bug: Regex Error in WebTopicList with Topics that have Meta Chars in the Name

TWiki dopic names normally do not contain meta characters in topic names. The WebTopicList fails with a regex error if a topic name contains a "++".

Test case

  • Create a topic named "C++Language"
  • Access WebTopicList
  • You get: Software error: / C++ProgrammingLanguage /: nested *?+ in regexp at TWiki.pm line 2514.

Environment

TWiki version: TWikiAlphaRelease
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- PeterThoeny - 04 May 2004

Follow up

Fix record

In TWikiAlphaRelease and TWiki.org.

*** TWiki.pm    3 May 2004 13:33:55 -0000       1.338
--- TWiki.pm    4 May 2004 16:18:43 -0000
***************
*** 154,160 ****

  # ===========================
  # TWiki version:
! $wikiversion      = "30 Apr 2004";

  # ===========================
  # Key Global variables, required for writeDebug
--- 154,160 ----

  # ===========================
  # TWiki version:
! $wikiversion      = "04 May 2004";

  # ===========================
  # Key Global variables, required for writeDebug
***************
*** 2526,2532 ****
          $line =~ s/\$web/$web/goi;
          $line =~ s/\$name/$item/goi;
          $line =~ s/\$qname/"$item"/goi;
!         $mark = ( $selection =~ / $item / ) ? $marker : "";
          $line =~ s/\$marker/$mark/goi;
          $text .= "$line$separator";
      }
--- 2526,2532 ----
          $line =~ s/\$web/$web/goi;
          $line =~ s/\$name/$item/goi;
          $line =~ s/\$qname/"$item"/goi;
!         $mark = ( $selection =~ / \Q$item\E / ) ? $marker : "";
          $line =~ s/\$marker/$mark/goi;
          $text .= "$line$separator";
      }

-- PeterThoeny - 04 May 2004

Peter:

  1. Was this ever in the spec? I think you've implemented a new feature rather than fixed a bug. When you say MetaChar, what is the full set of MetaChars that you are now allowing? Can we have anything in a TopicName?
  2. We should get a spec down for what is permitted as TopicName. For instance, can we now have '/', ':', '\', ''', '"' as well?
  3. Have you altered the WikiWord spec to match and, if not, are you intending to?

I'd welcome discussion around all of these.

-- MartinCleaver - 05 May 2004

No, it is not the intention to support meta chars in topic names. The fix is simply added protection to avoid a software error in case there is a topic with unsupported meta chars.

Meta chars are filtered from a [[...]] link when you click on the question mark to create the topic. However, creating orphaned topics via the GoBox or via a TWikiTemplates form should filter meta chars including spaces. See related TopicSaveErrorWithTopicsContainingSpace, RenameDoesNotCorrectSpacedTopics.

-- PeterThoeny - 05 May 2004

So what is the spec for what's allowed in a topic name? It seems you are saying TWiki "filters" them in some places but not in others; that would be inconsistent.

If we start with a spec we can build a test mechanism.

-- MartinCleaver - 05 May 2004

Please do not change a fixed bug to a brainstorming idea since it confuses the CairoRelease history. Best to follow up in an above mentioned topic or to create a new topic. (Strict topic names are $regex{wikiWordRegex} or $regex{abbrevRegex}. Other chars are tolerable like underlines, dashes etc. Off-limit is $securityFilter in TWiki.cfg)

-- PeterThoeny - 07 May 2004

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2004-07-16 - 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-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.