Ignore:
Timestamp:
Apr 8, 2006 8:35:17 AM (18 years ago)
Author:
scdev
Message:

changed addslashes to mysql_real_escape_string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1dev/bin/module_maker/skel/admin.php

    r89 r90  
    138138        if (getFormdata('repeat', false)) {
    139139            // Display edit function with next available ID.
    140             $qid = dbQuery("SELECT %PRIMARY_KEY% FROM %DB_TBL% WHERE %PRIMARY_KEY% > '" . addslashes(getFormData('%PRIMARY_KEY%')) . "' ORDER BY %PRIMARY_KEY% ASC LIMIT 1");
     140            $qid = dbQuery("SELECT %PRIMARY_KEY% FROM %DB_TBL% WHERE %PRIMARY_KEY% > '" . mysql_real_escape_string(getFormData('%PRIMARY_KEY%')) . "' ORDER BY %PRIMARY_KEY% ASC LIMIT 1");
    141141            if (list($next_id) = mysql_fetch_row($qid)) {
    142142                dieURL($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $next_id);
     
    204204            SELECT *
    205205            FROM %DB_TBL%
    206             WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'
     206            WHERE %PRIMARY_KEY% = '" . mysql_real_escape_string($id) . "'
    207207        ");
    208208        if (!$frm = mysql_fetch_assoc($qid)) {
     
    241241            SELECT <##>
    242242            FROM %DB_TBL%
    243             WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'
     243            WHERE %PRIMARY_KEY% = '" . mysql_real_escape_string($id) . "'
    244244        ");
    245245        if (! list($name) = mysql_fetch_row($qid)) {
     
    250250       
    251251        // Delete the record.
    252         dbQuery("DELETE FROM %DB_TBL% WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'");
     252        dbQuery("DELETE FROM %DB_TBL% WHERE %PRIMARY_KEY% = '" . mysql_real_escape_string($id) . "'");
    253253       
    254254        raiseMsg(sprintf(_("The %ITEM_TITLE% <strong>%s</strong> has been deleted."), $name), MSG_SUCCESS, __FILE__, __LINE__);
     
    320320    if (getFormData('filter_<##>', false)) {
    321321        // Limit by filter.
    322         $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . " <##> = '" . addslashes(getFormData('filter_<##>')) . "'";
     322        $where_clause .= (empty($where_clause) ? 'WHERE' : 'AND') . " <##> = '" . mysql_real_escape_string(getFormData('filter_<##>')) . "'";
    323323    }
    324324   
     
    400400        dbQuery("
    401401            UPDATE %DB_TBL% SET
    402                 rank = '" . addslashes($new_rank) . "'
    403             WHERE %PRIMARY_KEY% = '" . addslashes($id) . "'
     402                rank = '" . mysql_real_escape_string($new_rank) . "'
     403            WHERE %PRIMARY_KEY% = '" . mysql_real_escape_string($id) . "'
    404404        ");
    405405    }
Note: See TracChangeset for help on using the changeset viewer.