Dotclear


Ignore:
Timestamp:
04/27/15 14:33:53 (10 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Addresses #1647 - Missing clause for update. So update did not work when there were severals existings words.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/filters/class.dc.filter.words.php

    r2996 r3002  
    218218          } 
    219219 
    220           $rs_max = $this->con->select('SELECT MAX(rule_id) FROM '.$this->table); 
    221           $id = (integer) $rs_max->f(0) + 1; 
    222  
    223220          $cur = $this->con->openCursor($this->table); 
    224           $cur->rule_id = $id; 
    225221          $cur->rule_type = 'word'; 
    226222          $cur->rule_content = (string) $content; 
     
    233229 
    234230          if (!$rs->isEmpty() && $general) { 
    235                $cur->update(); 
     231               $cur->update('WHERE rule_id = '.$rs->rule_id); 
    236232          } else { 
     233               $rs_max = $this->con->select('SELECT MAX(rule_id) FROM '.$this->table); 
     234               $cur->rule_id = (integer) $rs_max->f(0) + 1; 
    237235               $cur->insert(); 
    238236          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map