• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5791: Topics using parenthesis in name cause regex errors

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Core Normal New   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Topics created with parenthesis in the topic name, such as NewTest(Topic) break TWiki

On 4.1.2, this seems to impact rename of other unrelated topics if the rename attempts to move the topic to another Web. A user who renames MyTestTopic from Sandbox to the Main web, and either web contains the NewTest(Topic) the rename of the topic will succeed, but then the rename script fails with premature end, and the user is either reported a 500 internal error, or in some cases gets a regular expression error with the NewTest( <===HERE reporting unmatched parenthesis.

On 5.0.0 17046 running from an SVN checkout of trunk, it is impossible to access the Rename menu once the incorrect topic has been created.. The "More Topic Actions" page fails with:

TWiki detected an internal error - please check your TWiki logs and webserver logs for more information.

path -E -i -l -H -- %TOKEN|U% %FILES|F% Grep for '%META:TOPICPARENT[{].*name=\"(Main\.)?WebHome\".*[}]%' returned error

and in the server error log:

/bin/grep -E -i -l -H -- %TOKEN|U% %FILES|F% Grep for '%META:TOPICPARENT[{].*name=\"(Main\.)?AnotherTopic\".*[}]%' returned error at /var/www/SVN/twiki/core/lib/TWiki/Store/SearchAlgorithms/Forking.pm line 85.

At this point even deleting all of the topics created during the test has not restored operation.

Javascript on the topic creator page will block this but persistent users can get around that by using the topic in the URL. This is probably a simple fix by adding \(\) to the default config parameter {NameFilter} Unless the intention is to support parenthesis in topic names.

-- TWiki:Main/GeorgeClark - 17 Jul 2008

We've also found that topics named including a backslash in the name breaks things. So that also needs to be either excluded.

-- TWiki:Main.GeorgeClark - 18 Jul 2008

From what I could see in 4.1.2, the parameter passed in the URL to specify the page being renamed is being inserted directly into the regexp searching for references to it. This would seem to be a security issue as any regexp metacharacters can be inserted; I suggest that all regexp metachacters in the topic name be quoted and possibly the name should also be properly untainted (e.g. by passing it through the NameFilter).

-- TWiki:Main.IsaacLin - 05 Aug 2008

ItemTemplate
Summary Topics using parenthesis in name cause regex errors
ReportedBy TWiki:Main.GeorgeClark
Codebase 4.1.2, ~twiki4
SVN Range TWiki-5.0.0, Thu, 17 Jul 2008, build 17046
AppliesTo Engine
Component Core
Priority Normal
CurrentState New
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-08-05 - IsaacLin
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback