Frank M. Kromann wrote: > I like the idea of a php.ini setting for the comspec (although this might > create OS specific ini files), and I do not like 'magick' stuff happening > to command parameters in any of the exec functions. > > According to Windows cmd specifications the quotes are needed if one of > the special characters is present in the command line. > > The special characters that require quotes are: > <space> > &()[]{}^=;!'+,`~ > > The user should know when to use quotes when calling any of the exec > functions.
Two sets of quotes are needed. Like this: $result = `""c:\\program files\\some program\\prog.exe" "filename""`; This won't work: $result = `"c:\\program files\\some program\\prog.exe" "filename"`; You think the user is meant to know that? I'm not suggesting magically adding quotes around filenames which contain special characters, that's the user's responsibility. I'm suggesting adding quotes around the entire command, with a /s switch preceding, so that the command specified by the user is successfully passed to the command interpreter. This kind of quoting is done on Unix, see tsrm_virtual_cwd.c around line 1016. But it is missing on Windows. It's a bug, plain and simple. -- Tim Starling -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php