File tree 1 file changed +5
-17
lines changed
1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -242,26 +242,14 @@ protected function _prep_args($args)
242
242
// If there is no $args[0], skip this and treat as an associative array
243
243
// This can happen if there is only a single key, for example this is passed to table->generate
244
244
// array(array('foo'=>'bar'))
245
- if (isset ($ args [0 ]) && count ($ args ) === 1 && is_array ($ args [0 ]))
245
+ if (isset ($ args [0 ]) && count ($ args ) === 1 && is_array ($ args [0 ]) && ! isset ( $ args [ 0 ][ ' data ' ]) )
246
246
{
247
- // args sent as indexed array
248
- if ( ! isset ($ args [0 ]['data ' ]))
249
- {
250
- foreach ($ args [0 ] as $ key => $ val )
251
- {
252
- $ args [$ key ] = (is_array ($ val ) && isset ($ val ['data ' ])) ? $ val : array ('data ' => $ val );
253
- }
254
- }
247
+ $ args = $ args [0 ];
255
248
}
256
- else
249
+
250
+ foreach ($ args as $ key => $ val )
257
251
{
258
- foreach ($ args as $ key => $ val )
259
- {
260
- if ( ! is_array ($ val ))
261
- {
262
- $ args [$ key ] = array ('data ' => $ val );
263
- }
264
- }
252
+ is_array ($ val ) OR $ args [$ key ] = array ('data ' => $ val );
265
253
}
266
254
267
255
return $ args ;
You can’t perform that action at this time.
0 commit comments