Révision 8fa03d70
Ajouté par Assos Assos il y a plus de 5 ans
drupal7/sites/all/modules/media/media.module | ||
---|---|---|
668 | 668 |
} |
669 | 669 |
|
670 | 670 |
/** |
671 |
* Utility function to recursively run check_plain on an array. |
|
671 |
* Custom implementation of array_walk_recursive() that works around a crash |
|
672 |
* some users have been experiencing with that function in PHP 7. |
|
672 | 673 |
* |
673 |
* @todo There is probably something in core I am not aware of that does this.
|
|
674 |
* @see https://www.drupal.org/project/media/issues/2998097
|
|
674 | 675 |
*/ |
675 |
function media_recursive_check_plain(&$value, $key) { |
|
676 |
$value = check_plain($value); |
|
676 |
function media_array_walk_recursive(&$array) { |
|
677 |
foreach ($array as $key => $value) { |
|
678 |
if (is_array($array[$key])) { |
|
679 |
media_array_walk_recursive($array[$key]); |
|
680 |
} |
|
681 |
else { |
|
682 |
$array[$key] = check_plain($array[$key]); |
|
683 |
} |
|
684 |
} |
|
677 | 685 |
} |
678 | 686 |
|
679 | 687 |
/** |
... | ... | |
1193 | 1201 |
if (!empty($title)) { |
1194 | 1202 |
$file->title = decode_entities(token_replace($title, array('file' => $file), $replace_options)); |
1195 | 1203 |
} |
1204 |
|
|
1205 |
// Reduce memory footprint and response size in media browser. |
|
1206 |
$file->file_contents = ''; |
|
1196 | 1207 |
} |
1197 | 1208 |
|
1198 | 1209 |
/** |
... | ... | |
1260 | 1271 |
} |
1261 | 1272 |
} |
1262 | 1273 |
|
1263 |
array_walk_recursive($params, 'media_recursive_check_plain');
|
|
1274 |
media_array_walk_recursive($params);
|
|
1264 | 1275 |
|
1265 | 1276 |
// Provide some default parameters. |
1266 | 1277 |
$params += array( |
Formats disponibles : Unified diff
Weekly update of contrib modules