• 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.

Item5222: When a web is renamed/moved, the tags aren't updated

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension TagMePlugin Normal Closed   n/a  

Edit Form Data

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

Detail

If you add tags to a topic, a corresponding file is created inside pub/_work_areas/TagMePlugin (_tags_WEB.TOPIC.txt). When you rename or move a topic, the tags file is correctly renamed. But if you rename or move a web, its tags are not updated.

After that, if you search for a tag that existed inside that web, you get inconsistent results.

-- TWiki:Main/GuilhermeGarnier - 08 Jan 2008

I found a solution for this bug. The plugin has to implement afterRenameHandler to know when a web is renamed/moved.

After implementing this function, I got an error message when trying to rename a web: "Insecure dependency in unlink while running with -T switch at ...". I found here that -T (taint) is a Perl parameter used to enforce security. When it's used, Perl don't let you call unlink (and other potentially dangerous functions) with parameters got from command line or get/post forms.

The solution I found for that, as recommended on the above link, is to use a regular expression to "untaint" the parameters. It worked, but it doesn't let you have characters other than alphanumerics, "_", "-" and "@" on the parameters. I think that's fine, as it's a topic name, but is there any other character allowed on topic names that isn't listed here? Also I think "@" isn't needed for that, right?

I'm attaching a patch to the current version of the plugin. Please test to see if there is any problem with it.

-- TWiki:Main.GuilhermeGarnier - 09 Jan 2008

As a sidenote: please observe that there are regular expressions defined in TWiki to match web and/or topic names, that you can probably use to untaint properly. See TWiki.TWikiFuncDotPm#get_RegularExpression_name_expr for more.

-- TWiki:Main.KoenMartens - 24 Apr 2008

ItemTemplate
Summary When a web is renamed/moved, the tags aren't updated
ReportedBy TWiki:Main.GuilhermeGarnier
Codebase 4.1.2
SVN Range TWiki-4.3.0, Sun, 30 Dec 2007, build 16120
AppliesTo Extension
Component TagMePlugin
Priority Normal
CurrentState Closed
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch TagMePlugin.pm.patch r1 manage 1.6 K 2008-01-09 - 20:30 GuilhermeGarnier Patch to correct the bug
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2013-09-29 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback