Skip to content

Commit

Permalink
Fix handle array keys in plugin settings
Browse files Browse the repository at this point in the history
Recursion assumes variable is an array, but it breaks if the variable is a string
  • Loading branch information
midnight-studios committed Nov 28, 2017
1 parent b6d7d14 commit 5677929
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions inc/plugins/_plugin.funcs.php
Expand Up @@ -1394,12 +1394,15 @@ function handle_array_keys_in_plugin_settings( & $a )
$new_arr[$k] = $v;
}

// Recurse:
foreach( array_keys( $v ) as $rk )
if( is_array( $v ) )
{
if( is_array( $v[$rk] ) )
// Recurse:
foreach( array_keys( $v ) as $rk )
{
handle_array_keys_in_plugin_settings($v[$rk]);
if( is_array( $v[$rk] ) )
{
handle_array_keys_in_plugin_settings($v[$rk]);
}
}
}
}
Expand Down

0 comments on commit 5677929

Please sign in to comment.