Commit 45acc5a4 authored by Dries's avatar Dries

- Patch #921098 by munzirtaha: !is_null() should be replaced by isset() because it's faster.

parent e0032eee
......@@ -1296,7 +1296,7 @@ function file_space_used($uid = NULL, $status = FILE_STATUS_PERMANENT) {
$query = db_select('file_managed', 'f');
$query->condition('f.status', $status);
$query->addExpression('SUM(f.filesize)', 'filesize');
if (!is_null($uid)) {
if (isset($uid)) {
$query->condition('f.uid', $uid);
}
return $query->execute()->fetchField();
......
......@@ -762,7 +762,7 @@ function _field_write_instance($instance, $update = FALSE) {
// If no weight specified, make sure the field sinks at the bottom.
if (!isset($instance['widget']['weight'])) {
$max_weight = field_info_max_weight($instance['entity_type'], $instance['bundle'], 'form');
$instance['widget']['weight'] = !is_null($max_weight) ? $max_weight + 1 : 0;
$instance['widget']['weight'] = isset($max_weight) ? $max_weight + 1 : 0;
}
// Check widget module.
$widget_type = field_info_widget_types($instance['widget']['type']);
......@@ -788,7 +788,7 @@ function _field_write_instance($instance, $update = FALSE) {
// If no weight specified, make sure the field sinks at the bottom.
if (!isset($display['weight'])) {
$max_weight = field_info_max_weight($instance['entity_type'], $instance['bundle'], $view_mode);
$display['weight'] = !is_null($max_weight) ? $max_weight + 1 : 0;
$display['weight'] = isset($max_weight) ? $max_weight + 1 : 0;
}
$instance['display'][$view_mode] = $display;
}
......
......@@ -639,7 +639,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
}
// Restore the original current theme.
if (!is_null($default_theme)) {
if (isset($default_theme)) {
$GLOBALS['theme_key'] = $default_theme;
}
else {
......
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