File tree Expand file tree Collapse file tree 1 file changed +12
-25
lines changed Expand file tree Collapse file tree 1 file changed +12
-25
lines changed Original file line number Diff line number Diff line change @@ -2970,36 +2970,23 @@ function settings2array(array $settings, &$ini_settings): void
2970
2970
function settings2params (array $ ini_settings ): string
2971
2971
{
2972
2972
$ settings = '' ;
2973
-
2973
+ $ deep = null ;
2974
2974
foreach ($ ini_settings as $ name => $ value ) {
2975
- if (IS_WINDOWS ) {
2976
- if (is_array ($ value )) {
2977
- foreach ($ value as $ val ) {
2978
- $ val = addslashes ($ val );
2979
- $ settings .= " -d \"$ name= $ val \"" ;
2980
- }
2981
- } else {
2982
- if (!empty ($ value ) && $ value [0 ] == '" ' ) {
2983
- $ len = strlen ($ value );
2984
-
2985
- if ($ value [$ len - 1 ] == '" ' ) {
2986
- $ value [0 ] = "' " ;
2987
- $ value [$ len - 1 ] = "' " ;
2988
- }
2989
- } else {
2990
- $ value = addslashes ($ value );
2991
- }
2992
-
2993
- $ settings .= " -d \"$ name= $ value \"" ;
2994
- }
2975
+ if (is_array ($ value )) {
2976
+ $ deep = true ;
2995
2977
} else {
2996
- // !IS_WINDOWS
2997
- foreach ((is_array ($ value ) ? $ value : [$ value ]) as $ val ) {
2998
- $ settings .= " -d " . escapeshellarg ($ name ) . "= " . escapeshellarg ($ val );
2978
+ $ deep = false ;
2979
+ $ value = [$ value ];
2980
+ }
2981
+ foreach ($ value as $ val ) {
2982
+ if (IS_WINDOWS && $ deep && strlen ($ val ) >= 2 && str_starts_with ($ val , '" ' ) && str_ends_with ($ val , '" ' )) {
2983
+ // hack introduced in cee97080d1f5c7469d4f877698f91ef9f97a3199
2984
+ // for unexplained/unknown reasons
2985
+ $ val = substr ($ val , strlen ('" ' ), -strlen ('" ' ));
2999
2986
}
2987
+ $ settings .= " -d " . escapeshellarg ($ name ) . '= ' . escapeshellarg ($ val );
3000
2988
}
3001
2989
}
3002
-
3003
2990
return $ settings ;
3004
2991
}
3005
2992
You can’t perform that action at this time.
0 commit comments