mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: addFieldToTab segfaulting under PHP 5.2
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@105264 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
56be2afbc5
commit
ca873121fa
@ -335,7 +335,8 @@ class FieldSet extends DataObjectSet {
|
||||
$i = 0;
|
||||
foreach($this->items as $child) {
|
||||
if($name == $child->Name() || $name == $child->id) {
|
||||
array_splice($this->items, $i, 0, array($item));
|
||||
// On PHP 5.2.6, using $this->items directly in array_splice can segfault
|
||||
$itms = $this->items; array_splice($itms, $i, 0, array($item));
|
||||
return $item;
|
||||
} elseif($child->isComposite()) {
|
||||
$ret = $child->insertBefore($item, $name);
|
||||
|
Loading…
Reference in New Issue
Block a user