Skip to content
Snippets Groups Projects
Commit 00a70f94 authored by Oleg Natalushko's avatar Oleg Natalushko
Browse files

Issue #3222697 by nmangold: Use mb_substr() instead of mb_strlen() in makeUnique()

parent 745afdd8
No related branches found
No related tags found
No related merge requests found
......@@ -4,5 +4,7 @@
"type": "drupal-module",
"license": "GPL-2.0+",
"minimum-stability": "dev",
"require": { }
"require": {
"ext-mbstring": "*"
}
}
......@@ -58,7 +58,7 @@ abstract class CommerceAutoSkuGeneratorBase extends PluginBase implements Comme
while (!$this->isUnique($entity, $output)) {
$counter_length = mb_strlen($i) + 1;
$un_prefixed_max_length = 255 - $counter_length;
$sku = mb_strlen($generated_sku, 0, $un_prefixed_max_length);
$sku = mb_substr($generated_sku, 0, $un_prefixed_max_length);
$output = $sku . '_' . $i;
$i++;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment