aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/sites.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/sites.php')
-rw-r--r--engine/lib/sites.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index 4d3de2794..c8636fdc8 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -268,17 +268,19 @@
if ($row)
{
- // Exists and you have access to it
- $result = update_data("UPDATE {$CONFIG->dbprefix}sites_entity set name='$name', description='$description', url='$url' where guid=$guid");
- if ($result!=false)
- {
- // Update succeeded, continue
- $entity = get_entity($guid);
- if (trigger_elgg_event('update',$entity->type,$entity)) {
- return true;
- } else {
- delete_entity($guid);
- }
+ // Exists and you have access to it
+ if ($exists = get_data_row("select guid from {$CONFIG->dbprefix}sites_entity where guid = {$guid}")) {
+ $result = update_data("UPDATE {$CONFIG->dbprefix}sites_entity set name='$name', description='$description', url='$url' where guid=$guid");
+ if ($result!=false)
+ {
+ // Update succeeded, continue
+ $entity = get_entity($guid);
+ if (trigger_elgg_event('update',$entity->type,$entity)) {
+ return true;
+ } else {
+ delete_entity($guid);
+ }
+ }
}
else
{