php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64844 PDO::quote() for mysql driver (wrong apostrophe replacing)
Submitted: 2013-05-15 15:57 UTC Modified: 2013-06-07 09:55 UTC
From: mariusz dot gomse at baobaz dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2013-05-15 15:57 UTC] mariusz dot gomse at baobaz dot com
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!'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-07 09:55 UTC] uw@php.net
-Status: Open +Status: Not a bug
 [2013-06-07 09:55 UTC] uw@php.net
The cited bug is an InnoDB server bug. Unrelated to driver.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 06:01:29 2024 UTC