mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Don't let $dataObject->ClassName be set to an improper value.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78678 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fb470bc53d
commit
bdeda543c9
@ -319,7 +319,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
* @param string $className The new ClassName attribute (a subclass of {@link DataObject})
|
* @param string $className The new ClassName attribute (a subclass of {@link DataObject})
|
||||||
*/
|
*/
|
||||||
function setClassName($className) {
|
function setClassName($className) {
|
||||||
$this->class = trim($className);
|
$className = trim($className);
|
||||||
|
if(!$className || !is_subclass_of($className, 'DataObject')) return;
|
||||||
|
|
||||||
|
$this->class = $className;
|
||||||
$this->setField("ClassName", $className);
|
$this->setField("ClassName", $className);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user