Skip to content

Commit

Permalink
Apply the changes from D6LTS 6.47 (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnopek authored and pwolanin committed Feb 13, 2019
1 parent f2b1e3d commit fd1bcf7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Drupal 6.47 LTS, 2019-01-02
---------------------------------------
- Improved support for PHP 7.2.

Drupal 6.46 LTS, 2018-10-17
---------------------------------------
- Fixed security issues (open redirect), backport. See SA-CORE-2018-006.
Expand Down
13 changes: 7 additions & 6 deletions includes/form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1424,14 +1424,15 @@ function form_set_value($form_item, $value, &$form_state) {
* the right array.
*/
function _form_set_value(&$form_values, $form_item, $parents, $value) {
// This makes PHP 7 have the same behavior as PHP 5 when the value is an
// empty string, rather than an array. This is depended on surprisingly
// often in Drupal 6 contrib.
if ($form_values === '') {
$form_values = array();
}

$parent = array_shift($parents);
if (empty($parents)) {
// This makes PHP 7 have the same behavior as PHP 5 when the value is an
// empty string, rather than an array. This is depended on surprisingly
// often in Drupal 6 contrib.
if ($form_values === '') {
$form_values = array();
}
$form_values[$parent] = $value;
}
else {
Expand Down
10 changes: 5 additions & 5 deletions includes/theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ function theme_submenu($links) {
function theme_table($header, $rows, $attributes = array(), $caption = NULL) {

// Add sticky headers, if applicable.
if (count($header)) {
if (!empty($header)) {
drupal_add_js('misc/tableheader.js');
// Add 'sticky-enabled' class to the table to identify it for JS.
// This is needed to target tables constructed by this function.
Expand All @@ -1385,24 +1385,24 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
}

// Format the table header:
if (count($header)) {
if (!empty($header)) {
$ts = tablesort_init($header);
// HTML requires that the thead tag has tr tags in it followed by tbody
// tags. Using ternary operator to check and see if we have any rows.
$output .= (count($rows) ? ' <thead><tr>' : ' <tr>');
$output .= (!empty($rows) ? ' <thead><tr>' : ' <tr>');
foreach ($header as $cell) {
$cell = tablesort_header($cell, $header, $ts);
$output .= _theme_table_cell($cell, TRUE);
}
// Using ternary operator to close the tags based on whether or not there are rows
$output .= (count($rows) ? " </tr></thead>\n" : "</tr>\n");
$output .= (!empty($rows) ? " </tr></thead>\n" : "</tr>\n");
}
else {
$ts = array();
}

// Format the table rows:
if (count($rows)) {
if (!empty($rows)) {
$output .= "<tbody>\n";
$flip = array('even' => 'odd', 'odd' => 'even');
$class = 'even';
Expand Down
14 changes: 9 additions & 5 deletions includes/unicode.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ function _unicode_check() {
if (ini_get('mbstring.encoding_translation') != 0) {
return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.encoding_translation</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
}
if (ini_get('mbstring.http_input') != 'pass') {
return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
}
if (ini_get('mbstring.http_output') != 'pass') {
return array(UNICODE_ERROR, $t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
// mbstring.http_input and mbstring.http_output are deprecated and empty by
// default in PHP 5.6.
if (version_compare(PHP_VERSION, '5.6.0') == -1) {
if (ini_get('mbstring.http_input') != 'pass') {
return array(UNICODE_ERROR, $t('Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_input</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
}
if (ini_get('mbstring.http_output') != 'pass') {
return array(UNICODE_ERROR, $t('Multibyte string output conversion in PHP is active and must be disabled. Check the php.ini <em>mbstring.http_output</em> setting. Please refer to the <a href="@url">PHP mbstring documentation</a> for more information.', array('@url' => 'http://www.php.net/mbstring')));
}
}

// Set appropriate configuration
Expand Down
3 changes: 2 additions & 1 deletion modules/book/book.module
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ function book_prev($book_link) {
// The previous page in the book may be a child of the previous visible link.
if ($prev['depth'] == $book_link['depth'] && $prev['has_children']) {
// The subtree will have only one link at the top level - get its data.
$data = array_shift(book_menu_subtree_data($prev));
$subtree = book_menu_subtree_data($prev);
$data = array_shift($subtree);
// The link of interest is the last child - iterate to find the deepest one.
while ($data['below']) {
$data = end($data['below']);
Expand Down
1 change: 1 addition & 0 deletions modules/profile/profile.module
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ function template_preprocess_profile_block(&$variables) {
// Supply filtered version of $fields that have values.
foreach ($variables['fields'] as $field) {
if ($field->value) {
$variables['profile'][$field->name] = new stdClass();
$variables['profile'][$field->name]->title = check_plain($field->title);
$variables['profile'][$field->name]->value = $field->value;
$variables['profile'][$field->name]->type = $field->type;
Expand Down
2 changes: 1 addition & 1 deletion 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.46');
define('VERSION', '6.47');

/**
* Core API compatibility.
Expand Down

0 comments on commit fd1bcf7

Please sign in to comment.