Skip to content

Commit

Permalink
db_prepare_string() remove special handling for mysql
Browse files Browse the repository at this point in the history
Since ADOdb's qstr() method calls mysql_real_escape_string() /
mysql_real_escape_string() depending on driver type, it does not make
sense to have special logic within database api to handle mysql
differently from mysqli. Let ADOdb quote the string.
  • Loading branch information
dregad committed Feb 13, 2014
1 parent c13c74b commit 49d4e76
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions core/database_api.php
Expand Up @@ -698,10 +698,7 @@ function db_prepare_string( $p_string ) {
return utf8_substr( $t_escaped, 1, utf8_strlen( $t_escaped ) - 2 );
break;
case 'mysql':
return mysql_real_escape_string( $p_string );
case 'mysqli':
# For some reason mysqli_escape_string( $p_string ) always returns an empty
# string. This is happening with PHP v5.0.2.
$t_escaped = $g_db->qstr( $p_string, false );
return utf8_substr( $t_escaped, 1, utf8_strlen( $t_escaped ) - 2 );
case 'postgres':
Expand Down

0 comments on commit 49d4e76

Please sign in to comment.