From 47ae4068bb604220feb12bfee3afa35ce18d2d33 Mon Sep 17 00:00:00 2001 From: Sander Roobol Date: Mon, 19 Aug 2002 19:45:46 +0000 Subject: [PATCH] Made unserialize handle floats with an E notation - bug #18654 Patch by Christophe Sollet . (I'll commit a new var_unserializer.c in a second) --- ext/standard/tests/serialize/003.phpt | 24 ++++++++++++++++++++++++ ext/standard/var_unserializer.re | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/serialize/003.phpt diff --git a/ext/standard/tests/serialize/003.phpt b/ext/standard/tests/serialize/003.phpt new file mode 100644 index 0000000000..43e9077382 --- /dev/null +++ b/ext/standard/tests/serialize/003.phpt @@ -0,0 +1,24 @@ +--TEST-- +unserialize() floats with E notation (#18654) +--POST-- +--GET-- +--FILE-- + +--EXPECT-- +d:100; +float(100) + +d:5.2E+25; +float(5.2E+25) + +d:8.529E-22; +float(8.529E-22) + +d:9E-09; +float(9.E-9) diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 185909492b..1e6dcd078c 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -92,7 +92,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) /*!re2c iv = [+-]? [0-9]+; nv = [+-]? ([0-9]* "." [0-9]+|[0-9]+ "." [0-9]+); -nvexp = nv [eE] [+-]? iv; +nvexp = (iv | nv) [eE] [+-]? iv; any = [\000-\277]; */ -- 2.50.1