Commit e53f58fb authored by Dries's avatar Dries
Browse files

- Patch #40631 by Chris Johnson: is_array() slower than isset() or empty().

parent 7334f762
......@@ -943,13 +943,13 @@ function system_update_151() {
// insert all entries from theme links into new menus
$num_inserted = 0;
if (is_array($ts) && is_array($ts[$menus[$loop]['links_var']])) {
if (isset($ts) && is_array($ts) && is_array($ts[$menus[$loop]['links_var']])) {
$links = $ts[$menus[$loop]['links_var']];
for ($i = 0; $i < count($links['text']); $i++) {
if ($links['text'][$i] != "" && $links['link'][$i] != "") {
$num_inserted ++;
$node_unalias = db_fetch_array(db_query("SELECT src FROM {url_alias} WHERE dst = '%s'", $links['link'][$i]));
if (is_array($node_unalias)) {
if (isset($node_unalias) && is_array($node_unalias)) {
$link_path = $node_unalias['src'];
}
else {
......@@ -984,7 +984,7 @@ function system_update_151() {
unset($ts[$menus[$loop]['more_var']]);
}
if (is_array($ts)) {
if (isset($ts) && is_array($ts)) {
variable_set('theme_settings', $ts);
}
......@@ -1118,7 +1118,7 @@ function system_update_159() {
$vid = db_next_id('{node_revisions}_vid');
while ($node = db_fetch_object($result)) {
$revisions = unserialize($node->revisions);
if (is_array($revisions) && count($revisions) > 0) {
if (!$revisions && is_array($revisions) && count($revisions) > 0) {
$revisions_query = array();
$revisions_args = array();
$book_query = array();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment