DLE: mysql escape string(): This function is deprecated; use mysql real escape string() instead

Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2023
Перейти к:навигация, поиск
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Ошибка

Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /var/www/lawyer/data/www/aksioma-ek.ru/engine/classes/mysqli.class.php on line 162


Решение - в файле engine/classes/mysqli.class.php заменить:

       function safesql( $source )
       {
               if ($this->db_id) return mysqli_real_escape_string ($this->db_id, $source);
               else return mysql_escape_string($source);
       }


на

       function safesql( $source )
       {
               if ($this->db_id) return mysqli_real_escape_string ($this->db_id, $source);
               else return ($source);
       }