New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Item10259: Renaming web may incorrectly modify links within topic starting with old web name

Priority: Urgent
Current State: Closed
Released In: 1.1.3
Target Release: patch
Applies To: Engine
Component: rename web
Reported By: KiltBear
Waiting For:
Last Change By: KennethLavrsen
The example:

  • I had a web named EdNet and I used the WebPreferences web rename link to rename it to Edu
  • Within the web I had topic pages that had links in the form of EdNetSomeTopicName and EdNetSomeOtherTopic
  • The links in the topic pages containing them were changed to EduSomeTopicName and EduSomeOtherTopic
  • The actual topics were not renamed, so the links broke.

So it seems that the code that combs through topics to find links with the web specified in the link is not looking for the period after the web name. So in this example it seems that it should have been trying to match and fix links that matched (using psuedo regex for the situation) ^EdNet\..* but instead was matching all links with ^EdNet.* ignoring the fact that the leading EdNet was not actually specifying a WEB name.

The web wasn't too big, so I was able to find and fix the links for my users, so I'll mark this as Normal priority. I bet folks don't rename webs all that often. I think the bug might have been around for quite a while, because it seems to be jogging a faint and distant memory.

-- KiltBear - 14 Jan 2011

This breaks our user's data. Raised to urgent.

-- PaulHarvey - 14 Jan 2011

Confirmed - this is indeed broken. Added a unit test to show the issue.

-- GeorgeClark - 15 Jan 2011

Also noted that a Web containing the renamed web is incorrectly renamed. EdNetTwo.SomeTopic becomes EduTwo.SomeTopic

-- GeorgeClark - 15 Jan 2011

I think I've fixed this - committed additional unit tests and fix to both trunk and release 1.1. Leaving open because this needs some more review to see if there are other cases that should or should not be handled. Also, need to check out quoted references.

-- GeorgeClark - 15 Jan 2011

Quoted references worked okay. Added to unit test.

-- GeorgeClark - 15 Jan 2011

Excellent work George smile Looks good and seems to work. Set WaitingFor Kilt, could you try replacing your lib/Foswiki/ with this one?

-- PaulHarvey - 15 Jan 2011

Added a unit test to verify that the same topic / web references are updated when renaming a subweb. changing to waiting for release.

-- GeorgeClark - 19 Jan 2011

ItemTemplate edit

Summary Renaming web may incorrectly modify links within topic starting with old web name
ReportedBy KiltBear
Codebase 1.1.2, 1.1.1, 1.1.0, 1.1.0 beta1, trunk
SVN Range
AppliesTo Engine
Component rename web
Priority Urgent
CurrentState Closed
Checkins distro:31eed7b70bd2 distro:23f1053a531d distro:b46f38584178 distro:03b7456a491b distro:25ed36f06d6a distro:fc2a43404903 distro:dbd1b9333b0a distro:c0e03869c388 distro:7e79ee7a2020 distro:129fd24ac297
TargetRelease patch
ReleasedIn 1.1.3
Topic revision: r22 - 16 Apr 2011, KennethLavrsen - This page was cached on 02 May 2018 - 05:54.

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