Skip to content

Commit

Permalink
db_query_bound escapes strings, don't double escape.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Apr 4, 2009
1 parent 3e0c10d commit 69c30e8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions core/plugin_api.php
Expand Up @@ -487,10 +487,9 @@ function plugin_priority( $p_basename ) {
*/
function plugin_is_installed( $p_basename ) {
$t_plugin_table = db_get_table( 'mantis_plugin_table' );
$c_basename = db_prepare_string( $p_basename );

$t_query = "SELECT COUNT(*) FROM $t_plugin_table WHERE basename=" . db_param();
$t_result = db_query_bound( $t_query, array( $c_basename ) );
$t_result = db_query_bound( $t_query, array( $p_basename ) );
return( 0 < db_result( $t_result ) );
}

Expand All @@ -515,11 +514,9 @@ function plugin_install( $p_plugin ) {

$t_plugin_table = db_get_table( 'mantis_plugin_table' );

$c_basename = db_prepare_string( $p_plugin->basename );

$t_query = "INSERT INTO $t_plugin_table ( basename, enabled )
VALUES ( " . db_param() . ", '1' )";
db_query_bound( $t_query, array( $c_basename ) );
db_query_bound( $t_query, array( $p_plugin->basename ) );

if( false === ( plugin_config_get( 'schema', false ) ) ) {
plugin_config_set( 'schema', -1 );
Expand Down Expand Up @@ -621,10 +618,9 @@ function plugin_uninstall( $p_plugin ) {
}

$t_plugin_table = db_get_table( 'mantis_plugin_table' );
$c_basename = db_prepare_string( $p_plugin->basename );

$t_query = "DELETE FROM $t_plugin_table WHERE basename=" . db_param();
db_query_bound( $t_query, array( $c_basename ) );
db_query_bound( $t_query, array( $p_plugin->basename ) );

plugin_push_current( $p_plugin->basename );

Expand Down

0 comments on commit 69c30e8

Please sign in to comment.