| | 75 | } |
|---|
| | 76 | |
|---|
| | 77 | // systems running on sqlite3 (or pgsql) this function is not available |
|---|
| | 78 | // instead of changing the whole code, lets hack our own version of this function. |
|---|
| | 79 | // according to the documentation found here: http://il2.php.net/mysql_real_escape_string |
|---|
| | 80 | // this shold be enough. |
|---|
| | 81 | // Fixes ticket: http://freepbx.org/trac/ticket/1963 |
|---|
| | 82 | if (!function_exists('mysql_real_escape_string')) { |
|---|
| | 83 | function mysql_real_escape_string($str) { |
|---|
| | 84 | $str = str_replace( "\x00", "\\" . "\x00", $str ); |
|---|
| | 85 | $str = str_replace( "\x1a", "\\" . "\x1a", $str ); |
|---|
| | 86 | $str = str_replace( "\n" , "\\". "\n" , $str ); |
|---|
| | 87 | $str = str_replace( "\r" , "\\". "\r" , $str ); |
|---|
| | 88 | $str = str_replace( "\\" , "\\". "\\" , $str ); |
|---|
| | 89 | $str = str_replace( "'" , "\\". "'" , $str ); |
|---|
| | 90 | $str = str_replace( '"' , "\\". '"' , $str ); |
|---|
| | 91 | return $str; |
|---|
| | 92 | } |
|---|