Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions includes/database.mysqli.inc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function db_status_report($phase) {
/**
* Returns the version of the database server currently in use.
*
* @return Database server version
*/
function db_version() {
global $active_db;
Expand Down Expand Up @@ -333,7 +332,7 @@ function db_decode_blob($data) {
*/
function db_escape_string($text) {
global $active_db;
return mysqli_real_escape_string($active_db, $text);
return mysqli_real_escape_string($active_db, $text ?? '');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions includes/form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ function drupal_process_form($form_id, &$form, &$form_state) {
// possibly ending execution. We make sure we do not react to the batch
// that is already being processed (if a batch operation performs a
// drupal_execute).
if ($batch =& batch_get() && !isset($batch['current_set'])) {
if ($batch = batch_get() && !isset($batch['current_set'])) {
// The batch uses its own copies of $form and $form_state for
// late execution of submit handers and post-batch redirection.
$batch['form'] = $form;
Expand Down Expand Up @@ -1379,7 +1379,7 @@ function form_type_textfield_value($form, $edit = FALSE) {
if ($edit !== FALSE) {
// Equate $edit to the form value to ensure it's marked for
// validation.
return str_replace(array("\r", "\n"), '', $edit);
return str_replace(array("\r", "\n"), '', $edit ?? '');
}
}

Expand Down
4 changes: 3 additions & 1 deletion includes/menu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ function _menu_translate(&$router_item, $map, $to_arg = FALSE) {
$link_map = explode('/', $router_item['path']);
for ($i = 0; $i < $router_item['number_parts']; $i++) {
if ($link_map[$i] == '%') {
$link_map[$i] = $path_map[$i];
if (array_key_exists($i, $path_map)) {
$link_map[$i] = $path_map[$i];
}
}
}
$router_item['href'] = implode('/', $link_map);
Expand Down
2 changes: 1 addition & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ function _install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pas
$function = 'drupal_test_'. $db_type;
if (!$function($db_url, $success)) {
if (isset($success['CONNECT'])) {
form_set_error('db_type', st('In order for Drupal to work, and to continue with the installation process, you must resolve all permission issues reported above. We were able to verify that we have permission for the following commands: %commands. For more help with configuring your database server, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what any of this means you should probably contact your hosting provider.', array('%commands' => implode($success, ', '))));
form_set_error('db_type', st('In order for Drupal to work, and to continue with the installation process, you must resolve all permission issues reported above. We were able to verify that we have permission for the following commands: %commands. For more help with configuring your database server, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what any of this means you should probably contact your hosting provider.', array('%commands' => implode(', ', $success))));
}
else {
form_set_error('db_type', '');
Expand Down
2 changes: 2 additions & 0 deletions modules/comment/comment.module
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ function comment_save($edit) {
$edit['name'] = $user->name;
}

$edit['format'] = $edit['format'] ?? FILTER_FORMAT_DEFAULT;

db_query("INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s')", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $edit['status'], $thread, $edit['name'], $edit['mail'], $edit['homepage']);
$edit['cid'] = db_last_insert_id('comments', 'cid');

Expand Down
10 changes: 5 additions & 5 deletions modules/node/node.module
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,13 @@ function node_get_types($op = 'types', $node = NULL, $reset = FALSE) {
case 'types':
return $_node_types;
case 'type':
return isset($_node_types[$type]) ? $_node_types[$type] : FALSE;
return isset($type) && isset($_node_types[$type]) ? $_node_types[$type] : FALSE;
case 'module':
return isset($_node_types[$type]->module) ? $_node_types[$type]->module : FALSE;
return isset($type) && isset($_node_types[$type]->module) ? $_node_types[$type]->module : FALSE;
case 'names':
return $_node_names;
case 'name':
return isset($_node_names[$type]) ? $_node_names[$type] : FALSE;
return isset($type) && isset($_node_names[$type]) ? $_node_names[$type] : FALSE;
}
}

Expand Down Expand Up @@ -1048,13 +1048,13 @@ function node_prepare($node, $teaser = FALSE) {
// First we'll overwrite the existing node teaser and body with
// the filtered copies! Then, we'll stick those into the content
// array and set the read more flag if appropriate.
$node->readmore = $node->teaser != $node->body;
$node->readmore = property_exists($node, 'teaser') && $node->teaser != $node->body;

if ($teaser == FALSE) {
$node->body = check_markup($node->body, $node->format, FALSE);
}
else {
$node->teaser = check_markup($node->teaser, $node->format, FALSE);
$node->teaser = check_markup(($node->teaser ?? ''), $node->format, FALSE);
}

$node->content['body'] = array(
Expand Down
2 changes: 1 addition & 1 deletion modules/system/system.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ function system_run_cron() {
* Menu callback: return information about PHP.
*/
function system_php() {
phpinfo();
phpinfo(~ (INFO_VARIABLES | INFO_ENVIRONMENT));
exit();
}

Expand Down
4 changes: 2 additions & 2 deletions modules/system/system.module
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* The current system version.
*/
define('VERSION', '6.60');
define('VERSION', '6.61');

/**
* Core API compatibility.
Expand All @@ -18,7 +18,7 @@ define('DRUPAL_CORE_COMPATIBILITY', '6.x');
/**
* Minimum supported version of PHP.
*/
define('DRUPAL_MINIMUM_PHP', '4.3.5');
define('DRUPAL_MINIMUM_PHP', '8.1');

/**
* Minimum recommended value of PHP memory_limit.
Expand Down
4 changes: 2 additions & 2 deletions modules/user/user.module
Original file line number Diff line number Diff line change
Expand Up @@ -1533,15 +1533,15 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) {
if ($register || ($GLOBALS['user']->uid == $uid && user_access('change own username')) || $admin) {
$form['account']['name'] = array('#type' => 'textfield',
'#title' => t('Username'),
'#default_value' => $edit['name'],
'#default_value' => ($edit['name'] ?? ''),
'#maxlength' => USERNAME_MAX_LENGTH,
'#description' => t('Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.'),
'#required' => TRUE,
);
}
$form['account']['mail'] = array('#type' => 'textfield',
'#title' => t('E-mail address'),
'#default_value' => $edit['mail'],
'#default_value' => ($edit['mail'] ?? ''),
'#maxlength' => EMAIL_MAX_LENGTH,
'#description' => t('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'),
'#required' => TRUE,
Expand Down
3 changes: 2 additions & 1 deletion update.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ function update_results_page() {
$output = '<p>Updates were attempted. If you see no failures below, you may proceed happily to the <a href="'. base_path() .'?q=admin">administration pages</a>. Otherwise, you may need to update your database manually.'. $log_message .'</p>';
}
else {
list($module, $version) = array_pop(reset($_SESSION['updates_remaining']));
$updates_remaining = reset($_SESSION['updates_remaining']);
list($module, $version) = array_pop($updates_remaining);
$output = '<p class="error">The update process was aborted prematurely while running <strong>update #'. $version .' in '. $module .'.module</strong>.'. $log_message;
if (module_exists('dblog')) {
$output .= ' You may need to check the <code>watchdog</code> database table manually.';
Expand Down