note 89864 added to function.mysql-real-escape-string

From: Date: Thu, 26 Mar 2009 12:08:22 +0000
Subject: note 89864 added to function.mysql-real-escape-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-152467@lists.php.net to get a copy of this message
There could be a memory leak when using mysql_real_escape_string() when you pass a SimpleXML node (which is an object) to this function. To avoid this, typecast it first e.g. <?php $escapedVar = mysql_real_escape_string( (string) $xml->node->name); ?> This may only be a problem if you are doing this thousands of times in a loop. ---- Server IP: 87.124.35.190 Probable Submitter: 81.136.172.247 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php Edit -- https://master.php.net/note/edit/89864 Del: integrated -- https://master.php.net/note/delete/89864/integrated Del: useless -- https://master.php.net/note/delete/89864/useless Del: bad code -- https://master.php.net/note/delete/89864/bad+code Del: spam -- https://master.php.net/note/delete/89864/spam Del: non-english -- https://master.php.net/note/delete/89864/non-english Del: in docs -- https://master.php.net/note/delete/89864/in+docs Del: other reasons-- https://master.php.net/note/delete/89864 Reject -- https://master.php.net/note/reject/89864 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152467) next »