rickywu-posh / php-sql-parser

Automatically exported from code.google.com/p/php-sql-parser
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Escaped values in $parser->parsed['VALUES'] become '' instead of \' #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
<?php

// require("php-sql-parser.php");
require("PHPSQLParser.php");

$sql = "INSERT INTO test (`name`) VALUES ('ben\'s test containing an escaped 
quote')";

$parser = new PHPSQLParser($sql);

echo "<pre>";
print_r( $parser->parsed );
echo "</pre>";

What is the expected output? What do you see instead?
EXPECTED:
[VALUES] => Array
        (
            [0] => ('ben\'s test containing an escaped quote')
        )

OBSERVED:
[VALUES] => Array
        (
            [0] => ('ben''s test containing an escaped quote')
        )

What version of the product are you using? On what operating system?
Both of the following have the issue:
http://www.phosco.info/php-sql-parser_current.zip
http://php-sql-parser.googlecode.com/svn/trunk/php-sql-parser.php

Original issue reported on code.google.com by ben.swin...@gmail.com on 5 Mar 2012 at 10:32

GoogleCodeExporter commented 8 years ago
Fixed in current version on 
https://www.phosco.info/publicsvn/php-sql-parser/trunk

Thanks for reporting
Andre

Original comment by pho...@gmx.de on 6 Mar 2012 at 8:35

GoogleCodeExporter commented 8 years ago
Many thanks for the quick response. Any chance you can briefly explain the fix?

The version I'm currently having to stick with isn't from your repository and I 
can't just drop in the update as it behaves slightly differently. I plan to 
move to your version but need to wait for my boss to schedule in some 
development time to port the legacy software.

Original comment by ben.swin...@gmail.com on 6 Mar 2012 at 8:41

GoogleCodeExporter commented 8 years ago
I can confirm that this has been fixed on the aforementioned repository.

Original comment by ben.swin...@gmail.com on 13 Mar 2012 at 10:00

GoogleCodeExporter commented 8 years ago

Original comment by pho...@gmx.de on 13 Mar 2012 at 12:11