From f69d6102936649ddfb2222204dbe100d442d442b Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Mon, 6 Aug 2007 21:36:01 +0000 Subject: [PATCH] Fixed unique URL segment generation when there is a number in the segment - http://www.silverstripe.com/contributions/flat/3528 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39629 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 428596183..79d1194be 100644 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -462,7 +462,7 @@ class SiteTree extends DataObject { $count = 1; while(DataObject::get_one("SiteTree", "URLSegment = '$this->URLSegment' $idFilter")) { $count++; - $this->URLSegment = ereg_replace('-[0-9]+','', $this->URLSegment) . "-$count"; + $this->URLSegment = ereg_replace('-[0-9]+$','', $this->URLSegment) . "-$count"; } // If the URLSegment has been changed, rewrite links