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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mike at ciredata dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-25 16:41 UTC] zeev
It works exactly as expected
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 10 01:01:28 2025 UTC