php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #579 magic_quotes_runtime set to off is not respected when retrieving blob data.
Submitted: 1998-07-24 23:29 UTC Modified: 1998-07-25 16:41 UTC
From: mike at ciredata dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 3.0.2a OS: debian, kernel 2.0.34
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
37 + 31 = ?
Subscribe to this entry?

 
 [1998-07-24 23:29 UTC] mike at ciredata dot com
note: magic_quotes_gpc & runtime are both disabled (0).

data for a jpeg:
original length: 2061
after addslashes: 2229
after strip: 2061
after select before strip: 2061
after select after strip: 4

code that produced the error (was tracking the bug down):

        $mylink  =  mysql_connect( "localhost", "mike", "mypass");
        mysql_select_db( "mydb",$mylink);
        $myqry  =  mysql_query( "delete  from  thumbs  where  oid  =  999999",$mylink);
        $fh  =  fopen( "1a.jpg", "r");
        $pic  =  fread($fh,filesize( "1a.jpg"));
        $mypic  =  addslashes($pic);
        $pic2  =  stripslashes($mypic);
        $pics  =  strlen($pic);
        $mypics  =  strlen($mypic);
        $pic2s  =  strlen($pic2);
        $myqry  =  mysql_query( "insert  into  thumbs  (oid,thumb)  values  ('999999','$mypic')",$mylink);
        $myqry  =  mysql_query( "select  *  from  thumbs  where  oid  =  '999999'",$mylink);
        $myarr  =  mysql_fetch_array($myqry);
        $mypic2  =  $myarr[ "thumb"];
        $mypic2s  =  strlen($mypic2);
        $mypic3  =  stripslashes($mypic2);
        $mypic3s  =  strlen($mypic3);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-25 16:41 UTC] zeev
It works exactly as expected
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC