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

V3.6a: Old php versions don't support anonymous functions

parent 307b81e1
No related branches found
No related tags found
No related merge requests found
BASE=ordernumber
PLUGINTYPE=vmshopper
VERSION=3.6
VERSION=3.6a
PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html $(BASE)/
......
......@@ -356,11 +356,14 @@ class plgVmShopperOrdernumber extends vmShopperPlugin {
}
}
protected function no_array($v) {
return !is_array($v);
}
protected function doReplacements ($fmt, $reps) {
// First, replace all random...[n] fields. This needs to be done with a regexp and a callback:
$fmt = preg_replace_callback ('/\[(random)(.*?)([0-9]*?)\]/', array($this, 'replaceRandom'), $fmt);
// Only use string-valued variables for replacement (array-valued variables can be used in custom variable definitions!)
$reps = array_filter($reps, function($v) { return !is_array($v);} );
$reps = array_filter($reps, array($this, "no_array") );
return str_ireplace (array_keys($reps), array_values($reps), $fmt);
}
......
......@@ -7,7 +7,7 @@
<authorUrl>http://www.open-tools.net/</authorUrl>
<copyright>Copyright (C) 2012-2015 Reinhold Kainhofer. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license>
<version>3.6</version>
<version>3.6a</version>
<releaseDate>2015-05-23</releaseDate>
<releaseType>Minor update</releaseType>
<downloadUrl>http://open-tools.net/virtuemart/advanced-ordernumbers.html</downloadUrl>
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment