]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed: wrong default behaviour in can_edit_entity_metadata
authorJerome Bakker <jeabakker@coldtrick.com>
Mon, 17 Jun 2013 12:47:49 +0000 (14:47 +0200)
committerJerome Bakker <jeabakker@coldtrick.com>
Mon, 17 Jun 2013 12:47:49 +0000 (14:47 +0200)
engine/lib/entities.php

index 072b268051d0f8eec52287c8db3986fac947838a..226cf5c6c606718a2f20e0c5768563bafd29d598 100644 (file)
@@ -761,7 +761,7 @@ function get_entity($guid) {
        // @todo We need a single Memcache instance with a shared pool of namespace wrappers. This function would pull an instance from the pool.
        static $shared_cache;
 
-       // We could also use: if (!(int) $guid) { return FALSE }, 
+       // We could also use: if (!(int) $guid) { return FALSE },
        // but that evaluates to a false positive for $guid = TRUE.
        // This is a bit slower, but more thorough.
        if (!is_numeric($guid) || $guid === 0 || $guid === '0') {
@@ -2126,7 +2126,7 @@ function can_edit_entity_metadata($entity_guid, $user_guid = 0, $metadata = null
 
                $return = null;
 
-               if ($metadata->owner_guid == 0) {
+               if ($metadata && ($metadata->owner_guid == 0)) {
                        $return = true;
                }
                if (is_null($return)) {