You are here

function media_array_walk_recursive in D7 Media 7.3

Same name and namespace in other branches
  1. 7.4 media.module \media_array_walk_recursive()
  2. 7.2 media.module \media_array_walk_recursive()

Custom implementation of array_walk_recursive() that works around a crash some users have been experiencing with that function in PHP 7.

See also

https://www.drupal.org/project/media/issues/2998097

1 call to media_array_walk_recursive()
media_set_browser_params in ./media.module
Provides a singleton of the params passed to the media browser.

File

./media.module, line 671
Media API

Code

function media_array_walk_recursive(&$array) {
  foreach ($array as $key => $value) {
    if (is_array($array[$key])) {
      media_array_walk_recursive($array[$key]);
    }
    else {
      $array[$key] = check_plain($array[$key]);
    }
  }
}