View Issue Details

IDProjectCategoryView StatusLast Update
0012513mantisbtbugtrackerpublic2011-08-05 02:45
Reporterdhx Assigned Todhx  
PrioritynormalSeveritymajorReproducibilitysometimes
Status closedResolutionduplicate 
Product Version1.2.3 
Summary0012513: history_localize_item is calling bug_revision_exists with a string argument where an integer is expected
Description

Within history_api, the history_localize_item function is calling the bug_revision_exists function of bug_revision_api with the wrong argument type. It should be sending an integer, not a string.

As bug_revision_api doesn't use db_prepare_int when building queries this error will result in SQL query execution errors when an integer field in the database is compared to the supplied string (type mismatch).

TagsNo tags attached.

Relationships

duplicate of 0011909 closeddhx Database query failed - problems with ticket revisions 

Activities

wolszew1

wolszew1

2010-11-17 04:27

reporter   ~0027394

For me - this error occurs when column fields of table mantis_bug_history_table old_value and new_value are empty.

I tested, that temporary solution without loosing functionality can be:

*** core/bug_revision_api.php.orig 2010-09-14 20:40:10.000000000 +0200
--- core/bug_revision_api.php 2010-11-17 10:08:40.000000000 +0100


* 88,93 **
--- 88,95 ----

  • @return bool Whether or not the bug revision exists
    */
    function bug_revision_exists( $p_revision_id ) {

    • if( empty($p_revision_id) )
    • return false;
      $t_bug_rev_table = db_get_table( 'mantis_bug_revision_table' );

      $t_query = "SELECT * FROM $t_bug_rev_table WHERE id=" . db_param();