Skip to content

Commit

Permalink
Merge pull request ezsystems#1102 from glye/ezp-23529_bad_object_rela…
Browse files Browse the repository at this point in the history
…tion_link

Fix EZP-23529: Storing a draft with a bad object relation link should no...
  • Loading branch information
glye committed Oct 30, 2014
2 parents c203f8f + 913dc38 commit c28cf73
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kernel/classes/ezcontentobject.php
Expand Up @@ -2833,6 +2833,14 @@ function addContentObjectRelation( $toObjectID,
"eZContentObject::addContentObjectRelation" );
return false;
}

if ( !eZContentObject::exists( $toObjectID ) )
{
eZDebug::writeError( "Related object ID (toObjectID): '$toObjectID', does not refer to any existing object.",
"eZContentObject::addContentObjectRelation" );
return false;
}

$fromObjectID =(int) $fromObjectID;
$attributeID =(int) $attributeID;
$fromObjectVersion =(int) $fromObjectVersion;
Expand Down

0 comments on commit c28cf73

Please sign in to comment.