php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61226 mysql_escape_string deprecated notice does not appear with E_ALL
Submitted: 2012-03-01 19:21 UTC Modified: 2017-04-02 14:41 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: dpk at dpk dot net Assigned:
Status: Wont fix Package: mysql (PECL)
PHP Version: 5.3.10 OS: All
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-03-01 19:21 UTC] dpk at dpk dot net
Description:
------------
mysql_escape_string was deprecated in PHP 5.3, but the deprecation notice is only 
displayed if you have MySQL trace_mode enabled. IMO, E_ALL should be sufficient to 
enable any deprecation notices for code distributed with PHP. Examples of other 
ext/* code that simply shows the error without additional conditions can be found 
in ext/date/php_date.c and ext/standard/string.c.

Test script:
---------------
<?php
error_reporting(E_ALL);
mysql_escape_string('foo');

Expected result:
----------------
Deprecated: mysql_escape_string(): This function is deprecated; use 
mysql_real_escape_string() instead. in /home/dpk/test.php on line 4

Actual result:
--------------
Actual result is blank.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-02 07:08 UTC] uw@php.net
There's indeed an inconsistency going back to 2008 and a test for a condition that should go away:

   1814  103321       georg 	if (MySG(trace_mode)){
   1815  253598       helly 		php_error_docref("function.mysql-real-escape-string" TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_real_escape_string() instead.");
   1816  103321       georg 	}

It's fixed in 5.4, however.
 [2017-04-02 14:41 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-02 14:41 UTC] tpunt@php.net
The mysql extension in no longer maintained since the mysqli and PDO extensions are favoured now. This issue will therefore be closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 09:01:27 2024 UTC