Req #64844 [NEW]: PDO::quote() for mysql driver (wrong apostrophe replacing)
From: mariusz dot gomse at baobaz dot com
Operating system: Irrelevant
PHP version: Irrelevant
Package: PDO related
Bug Type: Feature/Change Request
Bug description:PDO::quote() for mysql driver (wrong apostrophe replacing)
Description:
------------
According to http://bugs.mysql.com/bug.php?id=61656 mysql bug
PDO::quote()
method shouldn't change ' to \' for mysql driver. Should change for ''.
Test script:
---------------
<?php
$tmp = "Let's go!";
$pdo = new PDO("mysql:host=localhost;initStatements=SET NAMES
utf8;model=mysql4;type=pdo_mysql;pdoType=;active=1", 'root', '', array());
echo $pdo->quote($tmp);
?>
Expected result:
----------------
'Let''s go!'
Actual result:
--------------
'Let\'s go!'
--
Edit bug report at https://bugs.php.net/bug.php?id=64844&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64844&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64844&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64844&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64844&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64844&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64844&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64844&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64844&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64844&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64844&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=64844&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=64844&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64844&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64844&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64844&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64844&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64844&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64844&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64844&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64844&r=mysqlcfg
Thread (2 messages)
- mariusz dot gomse at baobaz dot com