I saw your notice in the code about wanting a regular expression here. I'd suggest:
preg_replace( '/[\/\\\]{2,}/', "/", $path );
I saw your notice in the code about wanting a regular expression here. I'd suggest:
preg_replace( '/[\/\\\]{2,}/', "/", $path );