diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1dcba6205e779078923a03c4a728374391371a62..041f4fddb69076cd11398f90d52985a1fa1ac3c6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -36,6 +36,7 @@ Features and enhancements - #1254398 - Prevent accidental emailing during migration. Bug fixes +- #1447368 - Handle purely numeric PHP memory_limit. - #1432802 - Default $options to prevent PHP 5.4 error. - #1333656 - Remove content type/fields when uninstalling migrate_example_baseball. - #1416012 - Cleanly handle NULL source key values in saveIDMapping(). diff --git a/includes/base.inc b/includes/base.inc index bbada55d2c465479d9960524e46d619b0f97d1d1..0721c8f2567a024d5973044e61d80f681103f6aa 100644 --- a/includes/base.inc +++ b/includes/base.inc @@ -314,18 +314,20 @@ abstract class MigrationBase { $this->memoryLimit = PHP_INT_MAX; } else { - $last = strtolower($limit[strlen($limit)-1]); - switch ($last) { - case 'g': - $limit *= 1024; - case 'm': - $limit *= 1024; - case 'k': - $limit *= 1024; - break; - default: - throw new Exception(t('Invalid PHP memory_limit !limit', - array('!limit' => $limit))); + if (!is_numeric($limit)) { + $last = strtolower($limit[strlen($limit)-1]); + switch ($last) { + case 'g': + $limit *= 1024; + case 'm': + $limit *= 1024; + case 'k': + $limit *= 1024; + break; + default: + throw new Exception(t('Invalid PHP memory_limit !limit', + array('!limit' => $limit))); + } } $this->memoryLimit = $limit; }