Changeset 1657

Show
Ignore:
Timestamp:
06/10/2007 05:57:27 PM (19 months ago)
Author:
robertb
Message:

SQL-Injektion und XSS behoben

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/CommentCloser.jplug.php

    r1654 r1657  
    33 * @name:        CommentCloser <jeenaparadies.net/projects/jlog/> 
    44 * @author:      Robert Bienert <robertbienert@gmx.net> 
    5  * @version:     1.1 
    6  * @date:        2007-05-26 
     5 * @version:     1.2 
     6 * @date:        2007-06-10 
    77 * 
    88 * Dieses Plugin schliesst nach einer bestimmten, festzulegenden 
     
    3838                        $lifeTime = $_POST['commclose_lifetime']; 
    3939                        $timeUnit = $_POST['commclose_unit']; 
    40                         # TODO Einheiten ueberpruefen 
     40                        // Einheiten pruefen 
     41                        if (! in_array($timeUnit, $this->_units)) 
     42                                $timeUnit = ''; 
    4143 
    42                         // keine negative Zeiten 
    43                         if ($lifeTime < 0) 
     44                        // keine (negative) Zeit XXX implicit cast 
     45                        if ($lifeTime + 0 <= 0) 
    4446                                $lifeTime = 0; 
    4547 
     
    8082                        $output .= $this->_units[$i]; 
    8183 
    82                         if ($this->_units[$i] == COMMENT_CLOSER_TIMEUNIT) 
     84                        if ($this->_units[$i] == $timeUnit) 
    8385                                $output .= '" selected="selected'; 
    8486 
     
    99101        // Pruefen auf zu schliessende Beitraege 
    100102        function hook_onUpdate($data) { 
     103                // Kein Schliessen gewuenscht, Plugin nicht konfiguriert 
     104                // oder ungueltige Werte gesetzt: 
    101105                if (!defined('COMMENT_CLOSER_LIFETIME') || 
    102                         COMMENT_CLOSER_LIFETIME == 0 || 
    103                         !defined('COMMENT_CLOSER_TIMEUNIT')) 
     106                        COMMENT_CLOSER_LIFETIME+0 <= 0 || 
     107                        !defined('COMMENT_CLOSER_TIMEUNIT') || 
     108                        !in_array(COMMENT_CLOSER_TIMEUNIT, 
     109                                $this->_units)) 
    104110                { 
    105111                        return $data;