Ticket #1394: db.diff

File db.diff, 667 bytes (added by auroraeosrose, 8 years ago)
  • wp-db.php

     
    7676        // ==================================================================== 
    7777        //      Format a string correctly for safe insert under all PHP conditions 
    7878         
    79         function escape($str) { 
    80                 return addslashes($str);                                 
     79        function escape ($string) { 
     80                if(!$this->dbh || version_compare(phpversion(),'4.3.0')=='-1') { 
     81                        return mysql_escape_string($string); 
     82                } else { 
     83                        return mysql_real_escape_string($string, $this->dbh); 
     84                } 
    8185        } 
    8286 
    8387        // ==================================================================