mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #2731 from creative-commoners/pulls/4/p81fix
ENH Various fixes for PHP 8.1 compatibility
This commit is contained in:
commit
13c1ae487f
@ -82,7 +82,7 @@ class SiteTreeURLSegmentField extends TextField
|
|||||||
$page->URLSegment = $page->generateURLSegment($request->getVar('value'));
|
$page->URLSegment = $page->generateURLSegment($request->getVar('value'));
|
||||||
$count = 2;
|
$count = 2;
|
||||||
while (!$page->validURLSegment()) {
|
while (!$page->validURLSegment()) {
|
||||||
$page->URLSegment = preg_replace('/-[0-9]+$/', null, $page->URLSegment) . '-' . $count;
|
$page->URLSegment = preg_replace('/-[0-9]+$/', '', $page->URLSegment) . '-' . $count;
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1652,7 +1652,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
// Ensure that this object has a non-conflicting URLSegment value.
|
// Ensure that this object has a non-conflicting URLSegment value.
|
||||||
$count = 2;
|
$count = 2;
|
||||||
while (!$this->validURLSegment()) {
|
while (!$this->validURLSegment()) {
|
||||||
$this->URLSegment = preg_replace('/-[0-9]+$/', null, $this->URLSegment) . '-' . $count;
|
$this->URLSegment = preg_replace('/-[0-9]+$/', '', $this->URLSegment) . '-' . $count;
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user