mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX Image_Cached record class name
Sanitise properties before updating
This commit is contained in:
parent
c4dc10b255
commit
15ae37cf03
@ -1040,7 +1040,12 @@ class Image_Cached extends Image {
|
|||||||
*/
|
*/
|
||||||
public function __construct($filename = null, $isSingleton = false, Image $sourceImage = null) {
|
public function __construct($filename = null, $isSingleton = false, Image $sourceImage = null) {
|
||||||
parent::__construct(array(), $isSingleton);
|
parent::__construct(array(), $isSingleton);
|
||||||
if ($sourceImage) $this->update($sourceImage->toMap());
|
if ($sourceImage) {
|
||||||
|
// Copy properties from source image, except unsafe ones
|
||||||
|
$properties = $sourceImage->toMap();
|
||||||
|
unset($properties['RecordClassName'], $properties['ClassName']);
|
||||||
|
$this->update($properties);
|
||||||
|
}
|
||||||
$this->ID = -1;
|
$this->ID = -1;
|
||||||
$this->Filename = $filename;
|
$this->Filename = $filename;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user