Changeset c9dcb83 in github


Ignore:
Timestamp:
Jul 23, 2012 4:40:48 AM (11 months ago)
Author:
Aleksander Machniak <alec@…>
Children:
40b6df3
Parents:
7eba085
Message:

Fixed PHP warning, added check for allowed characters in variable name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/managesieve/managesieve.php

    r7eba085 rc9dcb83  
    855855 
    856856                case 'set': 
     857                    $this->form['actions'][$i]['name'] = $varnames[$idx]; 
     858                    $this->form['actions'][$i]['value'] = $varvalues[$idx]; 
     859                    foreach ((array)$varmods[$idx] as $v_m) { 
     860                        $this->form['actions'][$i][$v_m] = true; 
     861                    } 
     862 
    857863                    if (empty($varnames[$idx])) { 
    858864                        $this->errors['actions'][$i]['name'] = $this->gettext('cannotbeempty'); 
    859865                    } 
    860                     if (empty($varvalues[$idx])) { 
     866                    else if (!preg_match('/^[0-9a-z_]+$/i', $varnames[$idx])) { 
     867                        $this->errors['actions'][$i]['name'] = $this->gettext('forbiddenchars'); 
     868                    } 
     869 
     870                    if (!isset($varvalues[$idx]) || $varvalues[$idx] === '') { 
    861871                        $this->errors['actions'][$i]['value'] = $this->gettext('cannotbeempty'); 
    862872                    } 
    863                     foreach ($varmods[$idx] as $v_m) { 
    864                         $this->form['actions'][$i][$v_m] = true; 
    865                     } 
    866                     $this->form['actions'][$i]['name'] = $varnames[$idx]; 
    867                     $this->form['actions'][$i]['value'] = $varvalues[$idx]; 
    868873                    break; 
    869874                } 
Note: See TracChangeset for help on using the changeset viewer.