- Rollback of E_ALL patch. Too much extra breakage.
parent
db7dcfd444
commit
3b543c18f5
|
@ -193,7 +193,7 @@ function file_check_upload($source = 'upload') {
|
|||
}
|
||||
|
||||
// If a file was uploaded, process it.
|
||||
if (isset($_FILES["files"]["name"][$source]) && is_uploaded_file($_FILES["files"]["tmp_name"][$source])) {
|
||||
if ($_FILES["files"]["name"][$source] && is_uploaded_file($_FILES["files"]["tmp_name"][$source])) {
|
||||
|
||||
// Check for file upload errors and return FALSE if a
|
||||
// lower level system error occurred.
|
||||
|
@ -253,7 +253,7 @@ function file_check_upload($source = 'upload') {
|
|||
|
||||
else {
|
||||
// In case of previews return previous file object.
|
||||
if (isset($_SESSION['file_uploads'][$source]->filepath) && file_exists($_SESSION['file_uploads'][$source]->filepath)) {
|
||||
if (file_exists($_SESSION['file_uploads'][$source]->filepath)) {
|
||||
return $_SESSION['file_uploads'][$source];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -367,7 +367,7 @@ function _menu_tree($result = NULL, $depth = 0, $link = array('link' => '', 'has
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (isset($link['link'])) {
|
||||
if ($link['link']) {
|
||||
$tree .= theme('menu_link', $link);
|
||||
}
|
||||
return array($remnant, $tree);
|
||||
|
|
|
@ -110,9 +110,6 @@ function module_rebuild_cache() {
|
|||
continue;
|
||||
}
|
||||
$files[$filename]->info = $file->info;
|
||||
if (!isset($files[$filename]->info['version'])) {
|
||||
$files[$filename]->info['version'] = NULL;
|
||||
}
|
||||
|
||||
// log the critical hooks implemented by this module
|
||||
$bootstrap = 0;
|
||||
|
|
|
@ -610,7 +610,6 @@ function theme_links($links, $attributes = array('class' => 'links')) {
|
|||
function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
|
||||
if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) {
|
||||
$attributes = drupal_attributes($attributes);
|
||||
$image_attributes = isset($image_attributes) ? $image_attributes : '';
|
||||
$url = (url($path) == $path) ? $path : (base_path() . $path);
|
||||
return '<img src="'. check_url($url) .'" alt="'. check_plain($alt) .'" title="'. check_plain($title) .'" '. $image_attributes . $attributes .' />';
|
||||
}
|
||||
|
|
|
@ -310,7 +310,7 @@ function theme_block_admin_display($form) {
|
|||
foreach (element_children($form) as $i) {
|
||||
$block = &$form[$i];
|
||||
// Only take form elements that are blocks.
|
||||
if (isset($block['info']) && is_array($block['info'])) {
|
||||
if (is_array($block['info'])) {
|
||||
// Fetch values
|
||||
$region = $block['region']['#default_value'];
|
||||
$status = $region != BLOCK_REGION_NONE;
|
||||
|
@ -337,7 +337,7 @@ function theme_block_admin_display($form) {
|
|||
$row[] = drupal_render($block['throttle']);
|
||||
}
|
||||
$row[] = drupal_render($block['configure']);
|
||||
$row[] = isset($block['delete']) ? drupal_render($block['delete']) : '';
|
||||
$row[] = $block['delete'] ? drupal_render($block['delete']) : '';
|
||||
$rows[] = $row;
|
||||
}
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ function block_box_form($edit = array()) {
|
|||
$form['info'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Block description'),
|
||||
'#default_value' => isset($edit['info']) ? $edit['info'] : '',
|
||||
'#default_value' => $edit['info'],
|
||||
'#maxlength' => 64,
|
||||
'#description' => t('A brief description of your block. Used on the <a href="@overview">block overview page</a>.', array('@overview' => url('admin/build/block'))),
|
||||
'#required' => TRUE,
|
||||
|
@ -580,7 +580,7 @@ function block_box_form($edit = array()) {
|
|||
$form['body_filter']['body'] = array(
|
||||
'#type' => 'textarea',
|
||||
'#title' => t('Block body'),
|
||||
'#default_value' => isset($edit['body']) ? $edit['body'] : '',
|
||||
'#default_value' => $edit['body'],
|
||||
'#rows' => 15,
|
||||
'#description' => t('The content of the block as shown to the user.'),
|
||||
'#weight' => -17,
|
||||
|
@ -631,7 +631,7 @@ function block_user($type, $edit, &$user, $category = NULL) {
|
|||
|
||||
break;
|
||||
case 'validate':
|
||||
if (!isset($edit['block'])) {
|
||||
if (!$edit['block']) {
|
||||
$edit['block'] = array();
|
||||
}
|
||||
return $edit;
|
||||
|
|
|
@ -507,7 +507,7 @@ function theme_book_navigation($node) {
|
|||
* This is a helper function for book_toc().
|
||||
*/
|
||||
function book_toc_recurse($nid, $indent, $toc, $children, $exclude) {
|
||||
if (isset($children[$nid])) {
|
||||
if ($children[$nid]) {
|
||||
foreach ($children[$nid] as $foo => $node) {
|
||||
if (!$exclude || $exclude != $node->nid) {
|
||||
$toc[$node->nid] = $indent .' '. $node->title;
|
||||
|
|
|
@ -439,7 +439,7 @@ function forum_form_container($edit = array()) {
|
|||
'#title' => t('Container name'),
|
||||
'#type' => 'textfield',
|
||||
'#default_value' => $edit['name'],
|
||||
'#maxlength' => 64,
|
||||
'#maxlength' => 255,
|
||||
'#description' => t('The container name is used to identify related forums.'),
|
||||
'#required' => TRUE
|
||||
);
|
||||
|
@ -496,7 +496,7 @@ function forum_form_forum($edit = array()) {
|
|||
$form['name'] = array('#type' => 'textfield',
|
||||
'#title' => t('Forum name'),
|
||||
'#default_value' => $edit['name'],
|
||||
'#maxlength' => 64,
|
||||
'#maxlength' => 255,
|
||||
'#description' => t('The forum name is used to identify related discussions.'),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
|
|
|
@ -1393,7 +1393,7 @@ function node_filter_form() {
|
|||
* Theme node administration filter form.
|
||||
*/
|
||||
function theme_node_filter_form($form) {
|
||||
$output = '<div id="node-admin-filter">';
|
||||
$output .= '<div id="node-admin-filter">';
|
||||
$output .= drupal_render($form['filters']);
|
||||
$output .= '</div>';
|
||||
$output .= drupal_render($form);
|
||||
|
@ -1404,8 +1404,8 @@ function theme_node_filter_form($form) {
|
|||
* Theme node administration filter selector.
|
||||
*/
|
||||
function theme_node_filters($form) {
|
||||
$output = '<ul class="clear-block">';
|
||||
if (isset($form['current']) && sizeof($form['current'])) {
|
||||
$output .= '<ul class="clear-block">';
|
||||
if (sizeof($form['current'])) {
|
||||
foreach (element_children($form['current']) as $key) {
|
||||
$output .= '<li>'. drupal_render($form['current'][$key]) .'</li>';
|
||||
}
|
||||
|
@ -1495,7 +1495,7 @@ function node_admin_nodes_validate($form_id, $form_values) {
|
|||
function node_admin_content() {
|
||||
$output = drupal_get_form('node_filter_form');
|
||||
|
||||
if (isset($_POST['operation']) && $_POST['operation'] == 'delete' && $_POST['nodes']) {
|
||||
if ($_POST['operation'] == 'delete' && $_POST['nodes']) {
|
||||
return drupal_get_form('node_multiple_delete_confirm');
|
||||
}
|
||||
// Call the form first, to allow for the form_values array to be populated.
|
||||
|
@ -1506,7 +1506,6 @@ function node_admin_content() {
|
|||
|
||||
function node_admin_nodes() {
|
||||
global $form_values;
|
||||
|
||||
$filter = node_build_filter_query();
|
||||
|
||||
$result = pager_query('SELECT n.*, u.name, u.uid FROM {node} n '. $filter['join'] .' INNER JOIN {users} u ON n.uid = u.uid '. $filter['where'] .' ORDER BY n.changed DESC', 50, 0, NULL, $filter['args']);
|
||||
|
@ -1523,7 +1522,6 @@ function node_admin_nodes() {
|
|||
$form['options']['operation'] = array('#type' => 'select', '#options' => $options, '#default_value' => 'approve');
|
||||
$form['options']['submit'] = array('#type' => 'submit', '#value' => t('Update'));
|
||||
|
||||
$nodes = array();
|
||||
$destination = drupal_get_destination();
|
||||
while ($node = db_fetch_object($result)) {
|
||||
$nodes[$node->nid] = '';
|
||||
|
@ -1545,7 +1543,7 @@ function theme_node_admin_nodes($form) {
|
|||
// Overview table:
|
||||
$header = array(theme('table_select_header_cell'), t('Title'), t('Type'), t('Author'), t('Status'), t('Operations'));
|
||||
|
||||
$output = drupal_render($form['options']);
|
||||
$output .= drupal_render($form['options']);
|
||||
if (isset($form['title']) && is_array($form['title'])) {
|
||||
foreach (element_children($form['title']) as $key) {
|
||||
$row = array();
|
||||
|
|
|
@ -354,10 +354,7 @@ function system_main_admin_page($arg = NULL) {
|
|||
usort($menu['children'], '_menu_sort');
|
||||
foreach ($menu['children'] as $mid) {
|
||||
$block = menu_get_item($mid);
|
||||
if (!isset($block['content'])) {
|
||||
$block['content'] = '';
|
||||
}
|
||||
if (isset($block['block callback']) && function_exists($block['block callback'])) {
|
||||
if ($block['block callback'] && function_exists($block['block callback'])) {
|
||||
$arguments = isset($block['block arguments']) ? $block['block arguments'] : array();
|
||||
$block['content'] .= call_user_func_array($block['block callback'], $arguments);
|
||||
}
|
||||
|
@ -374,7 +371,7 @@ function system_main_admin_page($arg = NULL) {
|
|||
function system_admin_menu_block($block) {
|
||||
return 'This page awaits rewrite'; // TODO: this needs to be rewritten for the new menu system.
|
||||
$content = array();
|
||||
if (isset($block['children']) && is_array($block['children'])) {
|
||||
if (is_array($block['children'])) {
|
||||
usort($block['children'], '_menu_sort');
|
||||
foreach ($block['children'] as $mid) {
|
||||
$item = menu_get_item($mid);
|
||||
|
@ -952,7 +949,7 @@ function system_theme_data() {
|
|||
$style->template = isset($theme->template) ? $theme->template : FALSE;
|
||||
$style->name = basename(dirname($style->filename));
|
||||
$style->owner = $theme->filename;
|
||||
$style->prefix = isset($theme->template) ? $theme->prefix : $theme->name;
|
||||
$style->prefix = $theme->template ? $theme->prefix : $theme->name;
|
||||
// do not double-insert styles with theme files in their directory
|
||||
if (array_key_exists($style->name, $themes)) {
|
||||
continue;
|
||||
|
@ -1163,7 +1160,7 @@ function system_themes() {
|
|||
function theme_system_themes($form) {
|
||||
foreach (element_children($form) as $key) {
|
||||
$row = array();
|
||||
if (isset($form[$key]['description']) && is_array($form[$key]['description'])) {
|
||||
if (is_array($form[$key]['description'])) {
|
||||
$row[] = drupal_render($form[$key]['screenshot']);
|
||||
$row[] = drupal_render($form[$key]['description']);
|
||||
$row[] = array('data' => drupal_render($form['status'][$key]), 'align' => 'center');
|
||||
|
@ -1237,9 +1234,6 @@ function system_modules($form_values = NULL) {
|
|||
return $confirm_form;
|
||||
}
|
||||
|
||||
// Modules to throttle.
|
||||
$throttle = array();
|
||||
|
||||
// Store module list for validation callback.
|
||||
$form['validation_modules'] = array('#type' => 'value', '#value' => $files);
|
||||
|
||||
|
@ -1292,7 +1286,7 @@ function system_modules($form_values = NULL) {
|
|||
|
||||
// Mark dependents disabled so user can not remove modules being depended on.
|
||||
$dependents = array();
|
||||
if (isset($file->info['dependents']) && is_array($file->info['dependents'])) {
|
||||
if (is_array($file->info['dependents'])) {
|
||||
foreach ($file->info['dependents'] as $dependent) {
|
||||
if ($files[$dependent]->status == 1) {
|
||||
$dependents[] = $files[$dependent]->info['name'] . t(' (<span class="admin-enabled">enabled</span>)');
|
||||
|
@ -1489,7 +1483,7 @@ function system_modules_submit($form_id, $form_values) {
|
|||
|
||||
$current_module_list = module_list(TRUE, FALSE);
|
||||
|
||||
if (isset($form_values['throttle']) && is_array($form_values['throttle'])) {
|
||||
if (is_array($form_values['throttle'])) {
|
||||
foreach ($form_values['throttle'] as $key => $choice) {
|
||||
db_query("UPDATE {system} SET throttle = %d WHERE type = 'module' and name = '%s'", $choice ? 1 : 0, $key);
|
||||
}
|
||||
|
@ -1841,7 +1835,7 @@ function system_status($check = FALSE) {
|
|||
* Helper function to sort requirements.
|
||||
*/
|
||||
function _system_sort_requirements($a, $b) {
|
||||
return (isset($a['weight']) && isset($b['weight'])) ? $a['weight'] - $b['weight'] : strcmp($a['title'], $b['title']);
|
||||
return (isset($a['weight']) || isset($b['weight'])) ? $a['weight'] - $b['weight'] : strcmp($a['title'], $b['title']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2174,7 +2168,7 @@ function system_admin_compact_mode() {
|
|||
*/
|
||||
function theme_admin_page($blocks) {
|
||||
$stripe = 0;
|
||||
$container = array('left' => '', 'right' => '');
|
||||
$container = array();
|
||||
|
||||
foreach ($blocks as $block) {
|
||||
if ($block_output = theme('admin_block', $block)) {
|
||||
|
@ -2329,7 +2323,7 @@ function system_get_module_admin_tasks($module) {
|
|||
function theme_system_admin_by_module($menu_items) {
|
||||
$stripe = 0;
|
||||
$output = '';
|
||||
$container = array('left' => '', 'right' => '');
|
||||
$container = array();
|
||||
|
||||
// Iterate over all modules
|
||||
foreach ($menu_items as $module => $block) {
|
||||
|
@ -2343,7 +2337,7 @@ function theme_system_admin_by_module($menu_items) {
|
|||
$block['description'] = t($description);
|
||||
|
||||
if ($block_output = theme('admin_block', $block)) {
|
||||
if (!isset($block['position'])) {
|
||||
if (!$block['position']) {
|
||||
// Perform automatic striping.
|
||||
$block['position'] = ++$stripe % 2 ? 'left' : 'right';
|
||||
}
|
||||
|
|
|
@ -716,7 +716,7 @@ function taxonomy_form_alter($form_id, &$form) {
|
|||
$form['taxonomy'][$vocabulary->vid]['#required'] = $vocabulary->required;
|
||||
}
|
||||
}
|
||||
if (isset($form['taxonomy']) && is_array($form['taxonomy']) && !empty($form['taxonomy'])) {
|
||||
if (is_array($form['taxonomy']) && !empty($form['taxonomy'])) {
|
||||
if (count($form['taxonomy']) > 1) { // Add fieldset only if form has more than 1 element.
|
||||
$form['taxonomy'] += array(
|
||||
'#type' => 'fieldset',
|
||||
|
|
|
@ -285,7 +285,7 @@ function _upload_prepare(&$node) {
|
|||
// Clean up old file previews if a post didn't get the user to this page.
|
||||
// i.e. the user left the edit page, because they didn't want to upload anything.
|
||||
if(count($_POST) == 0) {
|
||||
if (isset($_SESSION['file_previews']) && is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
|
||||
if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
|
||||
foreach ($_SESSION['file_previews'] as $fid => $file) {
|
||||
file_delete($file->filepath);
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ function _upload_prepare(&$node) {
|
|||
}
|
||||
|
||||
// Attach file previews to node object.
|
||||
if (isset($_SESSION['file_previews']) && is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
|
||||
if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) {
|
||||
foreach ($_SESSION['file_previews'] as $fid => $file) {
|
||||
if ($user->uid != 1) {
|
||||
// Here something.php.pps becomes something.php_.pps
|
||||
|
|
|
@ -1275,9 +1275,12 @@ function user_register() {
|
|||
|
||||
// Remove form_group around default fields if there are no other groups.
|
||||
if (!$extra) {
|
||||
foreach ($form['account'] as $key => $value) {
|
||||
$form[$key] = $value;
|
||||
}
|
||||
$form['name'] = $form['account']['name'];
|
||||
$form['mail'] = $form['account']['mail'];
|
||||
$form['pass'] = $form['account']['pass'];
|
||||
$form['status'] = $form['account']['status'];
|
||||
$form['roles'] = $form['account']['roles'];
|
||||
$form['notify'] = $form['account']['notify'];
|
||||
unset($form['account']);
|
||||
}
|
||||
else {
|
||||
|
@ -1819,7 +1822,7 @@ function user_admin_access() {
|
|||
if (count($rows) == 0) {
|
||||
$rows[] = array(array('data' => '<em>'. t('There are currently no access rules.') .'</em>', 'colspan' => 5));
|
||||
}
|
||||
$output = theme('table', $header, $rows);
|
||||
$output .= theme('table', $header, $rows);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
@ -2061,7 +2064,7 @@ function theme_user_admin_new_role($form) {
|
|||
$rows[] = array($name, t('locked'), $edit_permissions);
|
||||
}
|
||||
}
|
||||
$rows[] = array(drupal_render($form['name']), array('data' => drupal_render($form['submit']), 'colspan' => 2));
|
||||
$rows[] = array(drupal_render($form['name']), array('data' => drupal_render($form['submit']), colspan => 2));
|
||||
|
||||
$output = drupal_render($form);
|
||||
$output .= theme('table', $header, $rows);
|
||||
|
@ -2410,7 +2413,7 @@ function user_admin($callback_arg = '') {
|
|||
$output = drupal_get_form('user_register');
|
||||
break;
|
||||
default:
|
||||
if (isset($_POST['accounts']) && $_POST['operation'] == 'delete') {
|
||||
if ($_POST['accounts'] && $_POST['operation'] == 'delete') {
|
||||
$output = drupal_get_form('user_multiple_delete_confirm');
|
||||
}
|
||||
else {
|
||||
|
@ -2670,7 +2673,7 @@ function theme_user_filter_form($form) {
|
|||
*/
|
||||
function theme_user_filters($form) {
|
||||
$output = '<ul class="clear-block">';
|
||||
if (isset($form['current']) && sizeof($form['current'])) {
|
||||
if (sizeof($form['current'])) {
|
||||
foreach (element_children($form['current']) as $key) {
|
||||
$output .= '<li>'. drupal_render($form['current'][$key]) .'</li>';
|
||||
}
|
||||
|
|
|
@ -213,8 +213,8 @@ function phptemplate_page($content, $show_blocks = TRUE) {
|
|||
'primary_links' => menu_primary_links(),
|
||||
'search_box' => (theme_get_setting('toggle_search') ? drupal_get_form('search_theme_form') : ''),
|
||||
'secondary_links' => menu_secondary_links(),
|
||||
'sidebar_left' => isset($sidebar_left) ? $sidebar_left : '',
|
||||
'sidebar_right' => isset($sidebar_right) ? $sidebar_right : '',
|
||||
'sidebar_left' => $sidebar_left,
|
||||
'sidebar_right' => $sidebar_right,
|
||||
'site_name' => (theme_get_setting('toggle_name') ? variable_get('site_name', 'Drupal') : ''),
|
||||
'site_slogan' => (theme_get_setting('toggle_slogan') ? variable_get('site_slogan', '') : ''),
|
||||
'css' => drupal_add_css(),
|
||||
|
|
Loading…
Reference in New Issue