aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-22 23:42:26 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-22 23:42:26 +0000
commitdf4226866779f75eacab7f62da36b22dc21d5e44 (patch)
treee6c58d3d77187050fb4b966cc78a69766369c52c /engine
parent60c1387a16ea4944674b0c9da2273158d1fbf0b4 (diff)
downloadelgg-df4226866779f75eacab7f62da36b22dc21d5e44.tar.gz
elgg-df4226866779f75eacab7f62da36b22dc21d5e44.tar.bz2
Merged r6812:6837 from 1.7 branch to trunk (skipping some changes to plugins like groups and wire)
git-svn-id: http://code.elgg.org/elgg/trunk@6851 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/annotations.php3
-rw-r--r--engine/lib/entities.php4
-rw-r--r--engine/lib/plugins.php7
-rw-r--r--engine/schema/upgrades/2009100701.sql2
-rw-r--r--engine/start.php5
5 files changed, 14 insertions, 7 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index dcb29d0ab..7f5ab93f2 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -206,7 +206,9 @@ function create_annotation($entity_guid, $name, $value, $value_type, $owner_guid
if (trigger_elgg_event('create', 'annotation', $obj)) {
return $result;
} else {
+ // plugin returned false to reject annotation
delete_annotation($result);
+ return FALSE;
}
}
}
@@ -263,6 +265,7 @@ function update_annotation($annotation_id, $name, $value, $value_type, $owner_gu
if (trigger_elgg_event('update', 'annotation', $obj)) {
return true;
} else {
+ // @todo add plugin hook that sends old and new annotation information before db access
delete_annotation($annotation_id);
}
}
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 9b3895fd5..95807aab5 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1690,6 +1690,7 @@ function entity_row_to_elggstar($row) {
return $new_entity;
}
+ // load class for entity if one is registered
$classname = get_subtype_class_from_id($row->subtype);
if ($classname!="") {
if (class_exists($classname)) {
@@ -1702,7 +1703,8 @@ function entity_row_to_elggstar($row) {
error_log(sprintf(elgg_echo('ClassNotFoundException:MissingClass'), $classname));
}
}
- else {
+
+ if (!$new_entity) {
switch ($row->type) {
case 'object' :
$new_entity = new ElggObject($row);
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 47a103dcd..c2427c655 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -99,11 +99,13 @@ function get_plugin_list() {
$CONFIG->pluginlistcache = $plugins;
return $plugins;
} else {
+ // this only runs on install, otherwise uses serialized plugin order
$plugins = array();
if ($handle = opendir($CONFIG->pluginspath)) {
while ($mod = readdir($handle)) {
- if (!in_array($mod,array('.','..','.svn','CVS')) && is_dir($CONFIG->pluginspath . "/" . $mod)) {
+ // must be directory and not begin with a .
+ if (substr($mod, 0, 1) !== '.' && is_dir($CONFIG->pluginspath . "/" . $mod)) {
$plugins[] = $mod;
}
}
@@ -162,7 +164,8 @@ function regenerate_plugin_list($pluginorder = FALSE) {
// Add new plugins to the end
if ($handle = opendir($CONFIG->pluginspath)) {
while ($mod = readdir($handle)) {
- if (!in_array($mod,array('.','..','.svn','CVS')) && is_dir($CONFIG->pluginspath . "/" . $mod)) {
+ // must be directory and not begin with a .
+ if (substr($mod, 0, 1) !== '.' && is_dir($CONFIG->pluginspath . "/" . $mod)) {
if (!in_array($mod, $pluginorder)) {
$max = $max + 10;
$pluginorder[$max] = $mod;
diff --git a/engine/schema/upgrades/2009100701.sql b/engine/schema/upgrades/2009100701.sql
index dbf52b4da..74249e901 100644
--- a/engine/schema/upgrades/2009100701.sql
+++ b/engine/schema/upgrades/2009100701.sql
@@ -1,2 +1,2 @@
--- Previously was the UTF8 migration that is now in code at 2010033101.
+-- Previously was the UTF8 migration that is now in code at engine/lib/upgrades/2010033101.php
-- Keeping this file to force an overwrite and to avoid confusion with missing migrations.
diff --git a/engine/start.php b/engine/start.php
index 442222dc8..1acbef977 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -123,15 +123,14 @@ if (!substr_count($_SERVER["PHP_SELF"], "install.php")
}
// System booted, return to normal view
-set_input('view', $oldview);
-
-if (empty($oldview)) {
+if (!elgg_is_valid_view_type($oldview)) {
if (empty($CONFIG->view)) {
$oldview = 'default';
} else {
$oldview = $CONFIG->view;
}
}
+set_input('view', $oldview);
// Regenerate the simple cache if expired.
// Don't do it on upgrade, because upgrade does it itself.