Skip to content

Commit

Permalink
Fix PHP Warning: Undefined array key
Browse files Browse the repository at this point in the history
Fixes #775

Signed-off-by: Damien Regad <dregad@mantisbt.org>

Changes to original commit:
- use $key variable instead of calling key() function again
- remove unnecessary `@` operator.

Signed-off-by: Damien Regad <dregad@mantisbt.org>
  • Loading branch information
ioigoume authored and dregad committed Jan 1, 2022
1 parent e97474d commit ffdc14e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions adodb-xmlschema03.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,11 @@ function create( &$xmls ) {
// Option has an argument.
if( is_array( $opt ) ) {
$key = key( $opt );
$value = $opt[key( $opt )];
@$fldarray[$field_id][$key] .= $value;
$value = $opt[$key];
if(!isset($fldarray[$field_id][$key])) {
$fldarray[$field_id][$key] = "";
}
$fldarray[$field_id][$key] .= $value;
// Option doesn't have arguments
} else {
$fldarray[$field_id][$opt] = $opt;
Expand Down

0 comments on commit ffdc14e

Please sign in to comment.