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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mariusz dot gomse at baobaz dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Fri Dec 27 08:01:28 2024 UTC