|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-04-18 21:42 UTC] master-bx at users dot sourceforge dot net
Description: ------------ Some backslashes are lost after using that function, same bug seems to be in mysqli_real_escape_string. Another function (mysql_real_escape_string) does well, if this is not a bug please give me a solution to fix this. Thank you, hajo @ bxcp.com Reproduce code: --------------- $var = '\ \\ \\\'; $test = pg_escape_string($var); echo $test; Expected result: ---------------- '\ \\ \\\' Actual result: -------------- ' \ \\' PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 11:00:02 2025 UTC |
yes, here is my mysql testing code: <?php function sql_escape($var) { if(!isset($mq_gpc)) { $mq_gpc = ini_get('magic_quotes_gpc'); static $mq_gpc; } if(!empty($mq_gpc)) { stripslashes($var); } return <>($var); } ?> <> = mysql(i)_real_escape_string or pg_escape_string mysql works, mysqli and pg not, but i found a typo in a function that uses this one. i will go on testing ...