1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// SiteTree.php

protected function onBeforeWrite() {

[...]

// ~line: 1003
/*
  $count = 1;
  while (
   (class_exists($this->URLSegment) && is_subclass_of($this->URLSegment, 'RequestHandler')) ||
   SiteTree::get_by_url($this->URLSegment, $idFilter)
  ) {
   $count++;
   $this->URLSegment = ereg_replace('-[0-9]+$','', $this->URLSegment) . "-$count";
  }
*/

[...]