davidfrey wrote in php

Escaping on Win32

I have written a custom code parser in PHP using the following syntax:

[link: db_linkname text=Text to place in the appropriate tag's attribute]

I've been using the escapeshellcmd() function to escape the brackets (\[link: ...\]) before running a preg_replace() on the string. Everything has been working fine until I upgraded to PHP 5.0.1 on my Windows 2000 workstation. Now the escapeshellcmd() function is simply stripping the brackets off altogether (link: ...). I decided to test the function on a LAMP server (http://www.perturb.org/dfrey/test_escapeshellcmd.php), where the function works as I would expect. My previous installation (PHP 4.2.2) worked fine, so I would assume this problem is a byproduct of upgrading to 5.0.1 (either by configuration or design).

Does anyone know if this behavior is really by design?