From 1872ab1632353cdb8a73e99d3b7de1f4060d3469 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 8 May 2005 23:48:40 +0000 Subject: [PATCH] Clean up makeFlatExifTags; a simple foreach loop is a little easier on the eyes than the array_walk bit, and seems to explode and die less on PHP 5. --- includes/Exif.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/includes/Exif.php b/includes/Exif.php index e475771f63..3e57697d09 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -279,19 +279,22 @@ class Exif { */ function makeFlatExifTags() { $exif = $this->getExif(); - array_walk($exif, array(&$this, 'callback')); // note the reference + $this->extractTags( $exif ); } /** - * A callback function used by makeFlatExifTags() + * A recursing extractor function used by makeFlatExifTags() */ - function callback($val, $key) { - if (gettype($val) === 'array') - array_walk($val, array(&$this, 'callback')); - else - $this->mFlatExif[$key] = $val; + function extractTags( $tagset ) { + foreach( $tagset as $key => $val ) { + if( is_array( $val ) ) { + $this->extractTags( $val ); + } else { + $this->mFlatExif[$key] = $val; + } + } } - + /** * Produce a list of all Exif tags appropriate for user output * -- 2.20.1