From 1dc3f375bf2f0d035d2c6b90449f248e348d7290 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 22 Sep 2009 12:35:40 -0700 Subject: Updated to Exifer r4477. Fixes ticket #763. --- modules/exif/lib/exif.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'modules/exif') diff --git a/modules/exif/lib/exif.php b/modules/exif/lib/exif.php index a7b0d13a..189f61b5 100644 --- a/modules/exif/lib/exif.php +++ b/modules/exif/lib/exif.php @@ -158,10 +158,15 @@ function intel2Moto($intel) { return $cache[$intel]; } - $len = strlen($intel); $cache[$intel] = ''; - for($i = 0; $i <= $len; $i += 2) { - $cache[$intel] .= substr($intel, $len-$i, 2); + $len = strlen($intel); + if ($len > 1000) { + debugLogBacktrace('intel2Moto called with unreasonable data string: length='.$len); + trigger_error(sprintf((string) t('intel2Moto called with unreasonable data string: length=%s. See debug log for details. (Setting DEBUG_EXIF to true might help locate problem images.)'),$len)); + } else { + for($i = 0; $i <= $len; $i += 2) { + $cache[$intel] .= substr($intel, $len-$i, 2); + } } return $cache[$intel]; } @@ -1059,4 +1064,10 @@ function get35mmEquivFocalLength(&$result) { return null; } +if (!function_exists('debugLogBacktrace')) { + // define this function for stand-alone uses if exifier + function debugLogBacktrace($msg) { + } +} + ?> -- cgit v1.2.3