non security modules update
This commit is contained in:
@@ -86,16 +86,25 @@ function image_features_revert($module) {
|
||||
/**
|
||||
* Remove unnecessary keys for export.
|
||||
*/
|
||||
function _image_features_style_sanitize(&$style, $child = FALSE) {
|
||||
$omit = $child ? array('isid', 'ieid', 'storage') : array('isid', 'ieid', 'storage', 'module');
|
||||
if (is_array($style)) {
|
||||
foreach ($style as $k => $v) {
|
||||
if (in_array($k, $omit, TRUE)) {
|
||||
unset($style[$k]);
|
||||
}
|
||||
else if (is_array($v)) {
|
||||
_image_features_style_sanitize($style[$k], TRUE);
|
||||
}
|
||||
}
|
||||
function _image_features_style_sanitize(array &$style) {
|
||||
// Sanitize style: Don't export numeric IDs and things which get overwritten
|
||||
// in image_styles() or are code/storage specific. The name property will be
|
||||
// the key of the exported $style array.
|
||||
$style = array_diff_key($style, array_flip(array(
|
||||
'isid',
|
||||
'name',
|
||||
'module',
|
||||
'storage',
|
||||
)));
|
||||
|
||||
// Sanitize effects: all that needs to be kept is name, weight and data,
|
||||
// which holds all the style-specific configuration. Other keys are assumed
|
||||
// to belong to the definition of the effect itself, so not configuration.
|
||||
foreach ($style['effects'] as $id => $effect) {
|
||||
$style['effects'][$id] = array_intersect_key($effect, array_flip(array(
|
||||
'name',
|
||||
'data',
|
||||
'weight',
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user