Commit 71169689 authored by alexpott's avatar alexpott

Issue #3087461 by labboy0276: Optimizations to the substr process plugin

parent 868feb2b
......@@ -75,7 +75,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
throw new MigrateException('The start position configuration value should be an integer. Omit this key to capture from the beginning of the string.');
}
$length = isset($this->configuration['length']) ? $this->configuration['length'] : NULL;
if (!is_null($length) && !is_int($length)) {
if ($length !== NULL && !is_int($length)) {
throw new MigrateException('The character length configuration value should be an integer. Omit this key to capture from the start position to the end of the string.');
}
if (!is_string($value)) {
......@@ -83,8 +83,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
}
// Use optional start or length to return a portion of $value.
$new_value = mb_substr($value, $start, $length);
return $new_value;
return mb_substr($value, $start, $length);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment