Skip to content
Snippets Groups Projects
Commit 4b0e432a authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Version 1.2: Fix php 5.2: preg_replace_callback does not support lambda functions in php 5.2 :(

parent 94d928e0
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,12 @@ class plgVmShopperOrdernumber extends vmShopperPlugin {
'/\[(random)(.*?)([0-9]*?)\]/', // For randomTypeN, spit the three parts
'/\[([^\]]+)\]/' // Everything else matches whole variable name
);
return preg_replace_callback ($patterns, function ($match) use ($orderDetails) { return self::replacementCallback ($match, $orderDetails); }, $fmt);
$callback = function ($match) use ($orderDetails) {
return self::replacementCallback ($match, $orderDetails);
};
return preg_replace_callback ($patterns, $callback, $fmt);
// return preg_replace_callback ($patterns, function ($match) use ($orderDetails) { return self::replacementCallback ($match, $orderDetails); }, $fmt);
}
/* Type 0 means order number, type 1 means invoice number */
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment