Categories with quotes can't be deleted or disable

When creating new categories in the backend, one can create a category with quotes; tested with double quotes but not single, but one can not delete or disable the category.  There is an error in the mysql query in categories that truncates the category at the double quotes.  I created the category, Testing "test" and it was created without an error.  On trying to delete the category, I get the following:

Query:
DELETE FROM `sys_categories` WHERE `Category` = 'Testing ' AND `ID` = AND `Type` = ''
Mysql error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `Type` = ''' at line 2
 
The part of the code in categories.php is:
 

    // check actions
    if(bx_get('pathes') !== false) {
        $aPathes = bx_get('pathes');

        if(is_array($aPathes) && !empty($aPathes))
            foreach($_POST['pathes'] as $sValue) {
                list($sCategory, $sId, $sType) = split('%%', process_db_input($sValue, BX_TAGS_STRIP));
                if (bx_get('action_disable') !== false)
                    $oDb->query("UPDATE `sys_categories` SET `Status` = 'passive' WHERE
                        `Category` = '$sCategory' AND `ID` = $sId AND `Type` = '$sType'");
                else if(bx_get('action_delete') !== false)
                    $oDb->query("DELETE FROM `sys_categories` WHERE
                        `Category` = '$sCategory' AND `ID` = $sId AND `Type` = '$sType'");
            }
    }

 

As can be seen, the query becomes ill formed: WHERE `Category` = 'Testing ' AND `ID` = AND

What is the solution here; besides don't create categories with quotes; if that is the solution then the code should not allow categories to be created with quotes.  Creating the category though, is not the issue as that works.  The issue is that one can not delete or disable the category once it has been created.

Geeks, making the world a better place
Quote · 12 Aug 2013

Just want to know if this was noted or not.  The bug report forum should be monitored and it would be nice to get a notice such as; "Noted" or something so we know that our reported bug is now known by the development team.

Geeks, making the world a better place
Quote · 13 Aug 2013

Thank you for the report:

http://www.boonex.com/trac/dolphin/ticket/3271

Rules → http://www.boonex.com/terms
Quote · 14 Aug 2013

Fixed:

http://www.boonex.com/trac/dolphin/changeset/18281

Rules → http://www.boonex.com/terms
Quote · 5 May 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.