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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Fri Apr 19 02:01:29 2024 UTC