Browse files

Correct initialization check for multivalues

  • Loading branch information...
1 parent 54591a3 commit 9a604eb48bc8f0a13a208210ff05cd4eda7e61dc @adrianheine adrianheine committed Jun 18, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 syntax/entry.php
View
7 syntax/entry.php
@@ -77,7 +77,12 @@ function handle($match, $state, $pos, &$handler){
$column = $this->dthlp->_column($line[0]);
if (isset($matches[2])) $column['comment'] = $matches[2];
if($column['multi']){
- if(!is_array($data[$column['key']])) $data[$column['key']] = array(); // init with empty array
+ if(!isset($data[$column['key']])) {
+ // init with empty array
+ // Note that multiple occurrences of the field are
+ // practically merged
+ $data[$column['key']] = array();
+ }
$vals = explode(',',$line[1]);
foreach($vals as $val){
$val = trim($this->dthlp->_cleanData($val,$column['type']));

0 comments on commit 9a604eb

Please sign in to comment.