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

Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: TagMePlugin
Reported By: TWiki:Main.GuilhermeGarnier
Waiting For:
Last Change By: KenK
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

Switched back to "New" status, as it was waiting for feedback from Peter Thoeny, which is about as useful as asking a mole for sunbathing advice.

-- CrawfordCurrie - 26 Aug 2010

We are using the current plugin version as of 7/9/2012, and this problem still exists. The attached patch does not seem relevant to the current version. Does anyone have a more recent patch? Does anyone know if/when this problem is being addressed?

I changed status to Confirmed, since I have confirmed that the problem still exists.

-- KenK - 09 Jul 2012

ItemTemplate edit

Summary When a web is renamed/moved, the tags aren't updated
ReportedBy TWiki:Main.GuilhermeGarnier
SVN Range TWiki-4.3.0, Sun, 30 Dec 2007, build 16120
AppliesTo Extension
Component TagMePlugin
Priority Normal
CurrentState Confirmed
TargetRelease n/a
ReleasedIn n/a
Topic attachments
I Attachment Action Size Date Who Comment manage 1 K 09 Jan 2008 - 20:30 UnknownUser Patch to correct the bug
Topic revision: r6 - 09 Jul 2012, KenK - This page was cached on 13 Aug 2019 - 21:46.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy