diff --git a/fp-includes/core/core.bplustree.class.php b/fp-includes/core/core.bplustree.class.php index 78c9f01..fbe21fb 100755 --- a/fp-includes/core/core.bplustree.class.php +++ b/fp-includes/core/core.bplustree.class.php @@ -1778,6 +1778,8 @@ class BPlusTree { */ function setitem($key, $val) { + if (!is_numeric($val)) + trigger_error("Second parameter must be numeric", E_USER_ERROR); $curr_length = $this->length; $root =& $this->root; if (is_null($root)) trigger_error("not open", E_USER_ERROR); diff --git a/fp-includes/core/core.entry.php b/fp-includes/core/core.entry.php index bf3205d..b7f9374 100755 --- a/fp-includes/core/core.entry.php +++ b/fp-includes/core/core.entry.php @@ -109,7 +109,7 @@ if (!$update_title) $seek = $main->has_key($key, $val); - if (is_numeric($seek)) + if (!is_numeric($seek)) $seek = $main->setitem($key, $val); if (isset($entry['categories']) && is_array($entry['categories'])) { foreach ($entry['categories'] as $cat) { diff --git a/fp-includes/core/core.static.php b/fp-includes/core/core.static.php index b80398c..4cb4f9b 100755 --- a/fp-includes/core/core.static.php +++ b/fp-includes/core/core.static.php @@ -35,8 +35,8 @@ function static_save($entry, $id, $oldid=null) { $fname = STATIC_DIR . $id . EXT; - $entry['CONTENT'] = apply_filters('content_save_pre', $entry['CONTENT']); - $entry['SUBJECT'] = apply_filters('title_save_pre', $entry['SUBJECT']); + $entry['content'] = apply_filters('content_save_pre', $entry['content']); + $entry['subject'] = apply_filters('title_save_pre', $entry['subject']); $str = utils_kimplode($entry);