Skip to content

Commit fd1bcf7

Browse files
dsnopekpwolanin
authored andcommitted
Apply the changes from D6LTS 6.47 (#125)
1 parent f2b1e3d commit fd1bcf7

File tree

7 files changed

+29
-18
lines changed

7 files changed

+29
-18
lines changed

CHANGELOG.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Drupal 6.47 LTS, 2019-01-02
2+
---------------------------------------
3+
- Improved support for PHP 7.2.
4+
15
Drupal 6.46 LTS, 2018-10-17
26
---------------------------------------
37
- Fixed security issues (open redirect), backport. See SA-CORE-2018-006.

includes/form.inc

+7-6
Original file line numberDiff line numberDiff line change
@@ -1424,14 +1424,15 @@ function form_set_value($form_item, $value, &$form_state) {
14241424
* the right array.
14251425
*/
14261426
function _form_set_value(&$form_values, $form_item, $parents, $value) {
1427+
// This makes PHP 7 have the same behavior as PHP 5 when the value is an
1428+
// empty string, rather than an array. This is depended on surprisingly
1429+
// often in Drupal 6 contrib.
1430+
if ($form_values === '') {
1431+
$form_values = array();
1432+
}
1433+
14271434
$parent = array_shift($parents);
14281435
if (empty($parents)) {
1429-
// This makes PHP 7 have the same behavior as PHP 5 when the value is an
1430-
// empty string, rather than an array. This is depended on surprisingly
1431-
// often in Drupal 6 contrib.
1432-
if ($form_values === '') {
1433-
$form_values = array();
1434-
}
14351436
$form_values[$parent] = $value;
14361437
}
14371438
else {

includes/theme.inc

+5-5
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ function theme_submenu($links) {
13711371
function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
13721372

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

13871387
// Format the table header:
1388-
if (count($header)) {
1388+
if (!empty($header)) {
13891389
$ts = tablesort_init($header);
13901390
// HTML requires that the thead tag has tr tags in it followed by tbody
13911391
// tags. Using ternary operator to check and see if we have any rows.
1392-
$output .= (count($rows) ? ' <thead><tr>' : ' <tr>');
1392+
$output .= (!empty($rows) ? ' <thead><tr>' : ' <tr>');
13931393
foreach ($header as $cell) {
13941394
$cell = tablesort_header($cell, $header, $ts);
13951395
$output .= _theme_table_cell($cell, TRUE);
13961396
}
13971397
// Using ternary operator to close the tags based on whether or not there are rows
1398-
$output .= (count($rows) ? " </tr></thead>\n" : "</tr>\n");
1398+
$output .= (!empty($rows) ? " </tr></thead>\n" : "</tr>\n");
13991399
}
14001400
else {
14011401
$ts = array();
14021402
}
14031403

14041404
// Format the table rows:
1405-
if (count($rows)) {
1405+
if (!empty($rows)) {
14061406
$output .= "<tbody>\n";
14071407
$flip = array('even' => 'odd', 'odd' => 'even');
14081408
$class = 'even';

includes/unicode.inc

+9-5
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ function _unicode_check() {
5959
if (ini_get('mbstring.encoding_translation') != 0) {
6060
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')));
6161
}
62-
if (ini_get('mbstring.http_input') != 'pass') {
63-
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')));
64-
}
65-
if (ini_get('mbstring.http_output') != 'pass') {
66-
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')));
62+
// mbstring.http_input and mbstring.http_output are deprecated and empty by
63+
// default in PHP 5.6.
64+
if (version_compare(PHP_VERSION, '5.6.0') == -1) {
65+
if (ini_get('mbstring.http_input') != 'pass') {
66+
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')));
67+
}
68+
if (ini_get('mbstring.http_output') != 'pass') {
69+
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')));
70+
}
6771
}
6872

6973
// Set appropriate configuration

modules/book/book.module

+2-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,8 @@ function book_prev($book_link) {
556556
// The previous page in the book may be a child of the previous visible link.
557557
if ($prev['depth'] == $book_link['depth'] && $prev['has_children']) {
558558
// The subtree will have only one link at the top level - get its data.
559-
$data = array_shift(book_menu_subtree_data($prev));
559+
$subtree = book_menu_subtree_data($prev);
560+
$data = array_shift($subtree);
560561
// The link of interest is the last child - iterate to find the deepest one.
561562
while ($data['below']) {
562563
$data = end($data['below']);

modules/profile/profile.module

+1
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ function template_preprocess_profile_block(&$variables) {
490490
// Supply filtered version of $fields that have values.
491491
foreach ($variables['fields'] as $field) {
492492
if ($field->value) {
493+
$variables['profile'][$field->name] = new stdClass();
493494
$variables['profile'][$field->name]->title = check_plain($field->title);
494495
$variables['profile'][$field->name]->value = $field->value;
495496
$variables['profile'][$field->name]->type = $field->type;

modules/system/system.module

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* The current system version.
1010
*/
11-
define('VERSION', '6.46');
11+
define('VERSION', '6.47');
1212

1313
/**
1414
* Core API compatibility.

0 commit comments

Comments
 (0)