mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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
This commit is contained in:
parent
bf8357f2ef
commit
f69d610293
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user