|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 04:00:01 2025 UTC |
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.