diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-22 12:35:40 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-09-22 12:35:40 -0700 |
commit | 1dc3f375bf2f0d035d2c6b90449f248e348d7290 (patch) | |
tree | 891d678a255bc1b691bf4e68d519f45ed779f4bd /modules/exif | |
parent | 2117d7725e636ce408b85501032bc8aff86d3000 (diff) |
Updated to Exifer r4477. Fixes ticket #763.
Diffstat (limited to 'modules/exif')
-rw-r--r-- | modules/exif/lib/exif.php | 17 |
1 files changed, 14 insertions, 3 deletions
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) { + } +} + ?> |