summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjvoisin2017-10-30 14:32:44 +0100
committerjvoisin2017-10-30 14:34:29 +0100
commit0c77d1dcd817bd159682344d186e920cd8c9c150 (patch)
tree43705cd797b8422ee76c974395c3dafca293e096 /src
parent7757a9a46fe7379292b1b99df692f90a131e5bc7 (diff)
Minor code cleanup
Diffstat (limited to 'src')
-rw-r--r--src/sp_utils.c7
-rw-r--r--src/tests/disabled_functions_param_array.phpt17
2 files changed, 1 insertions, 23 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c
index fdd2b66..1ba0fe7 100644
--- a/src/sp_utils.c
+++ b/src/sp_utils.c
@@ -183,19 +183,14 @@ int sp_log_request(const char* folder) {
183 183
184static char *zv_str_to_char(zval *zv) { 184static char *zv_str_to_char(zval *zv) {
185 zval copy; 185 zval copy;
186 char *ret;
187
188 186
189 ZVAL_ZVAL(&copy, zv, 1, 0); 187 ZVAL_ZVAL(&copy, zv, 1, 0);
190 // str = zend_string_dup(Z_STR_P(zv), 0);
191 for (size_t i = 0; i < Z_STRLEN(copy); i++) { 188 for (size_t i = 0; i < Z_STRLEN(copy); i++) {
192 if (Z_STRVAL(copy)[i] == '\0') { 189 if (Z_STRVAL(copy)[i] == '\0') {
193 Z_STRVAL(copy)[i] = '0'; 190 Z_STRVAL(copy)[i] = '0';
194 } 191 }
195 } 192 }
196 ret = estrdup(Z_STRVAL(copy)); 193 return estrdup(Z_STRVAL(copy));
197 // zend_string_release(str);
198 return ret;
199} 194}
200 195
201 196
diff --git a/src/tests/disabled_functions_param_array.phpt b/src/tests/disabled_functions_param_array.phpt
index 8fb75e1..5ca13aa 100644
--- a/src/tests/disabled_functions_param_array.phpt
+++ b/src/tests/disabled_functions_param_array.phpt
@@ -17,23 +17,6 @@ foo($a);
17 17
18$a=Array("a"=>"abcd"); 18$a=Array("a"=>"abcd");
19foo($a); 19foo($a);
20/*
21
22$a=Array("bla"=>"abcdef");
23foo($a);
24
25$a=Array("bla"=>"aaa", "a"=>"eee" );
26foo($a);
27
28$a=Array("test"=>"aaa", "a"=>"fff" );
29foo($a);
30
31$a=Array("test2"=>Array("foo"=>Array("lol"=>"bbb")), "a"=>"cccc");
32foo($a);
33
34$a=Array("test2"=>Array("foo"=>Array("lol"=>"aaa")), "a"=>"dddd");
35foo($a);
36 */
37?> 20?>
38--EXPECTF-- 21--EXPECTF--
39test1 22test1