lib/prince.php
private function cmdlineArgEscape1($argStr)
    {
        //chr(34) is character double quote ( " ), chr(92) is character backslash ( \ ).
        $len = strlen($argStr);

        $outputStr = '';
        $numSlashes = 0;
        $subStrStart = 0;

        for($i = 0; $i < $len; $i++)
        {
            if($argStr[$i] == chr(34))
            {
                $numSlashes = 0;
                $j = $i - 1;
                while($j >= 0)
                {
                    if($argStr[$j] == chr(92))
                    {
                        $numSlashes += 1;
                        $j -= 1;
                    }
                    else
                    {
                        break;
                    }
                }

                $outputStr .= substr($argStr, $subStrStart, ($i - $numSlashes - $subStrStart));

                for($k = 0; $k < $numSlashes; $k++)
                {
                    $outputStr .= chr(92) . chr(92);
                }
                $outputStr  .= chr(92) . chr(34);

                $subStrStart = $i + 1;
            }
        }
        $outputStr .= substr($argStr, $subStrStart, ($i - $subStrStart));

        return $outputStr;
    }
private function cmdlineArgEscape1($argStr)
    {
        //chr(34) is character double quote ( " ), chr(92) is character backslash ( \ ).
        $len = strlen($argStr);

        $outputStr = '';
        $numSlashes = 0;
        $subStrStart = 0;

        for($i = 0; $i < $len; $i++)
        {
            if($argStr[$i] == chr(34))
            {
                $numSlashes = 0;
                $j = $i - 1;
                while($j >= 0)
                {
                    if($argStr[$j] == chr(92))
                    {
                        $numSlashes += 1;
                        $j -= 1;
                    }
                    else
                    {
                        break;
                    }
                }

                $outputStr .= substr($argStr, $subStrStart, ($i - $numSlashes - $subStrStart));

                for($k = 0; $k < $numSlashes; $k++)
                {
                    $outputStr .= chr(92) . chr(92);
                }
                $outputStr  .= chr(92) . chr(34);

                $subStrStart = $i + 1;
            }
        }
        $outputStr .= substr($argStr, $subStrStart, ($i - $subStrStart));

        return $outputStr;
    }
will be replaced with: n*backslash + doublequote => (2*n+1)*backslash + doublequote