diff options
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) { + } +} + ?> |