The branch, master has been updated via 02b32a14b576d6e398e4b301cddda41537a5f01a (commit) from 859720342838f03862087352dfd535bf92e8613d (commit)
- Log ----------------------------------------------------------------- commit 02b32a14b576d6e398e4b301cddda41537a5f01a Author: Rouslan Placella rouslan@placella.com Date: Wed Jul 13 12:29:02 2011 +0100
PHP's in_array does not work on multidimential arrays
-----------------------------------------------------------------------
Summary of changes: libraries/rte/rte_routines.lib.php | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php index eb6ee4e..a5a136f 100644 --- a/libraries/rte/rte_routines.lib.php +++ b/libraries/rte/rte_routines.lib.php @@ -1100,7 +1100,22 @@ function PMA_RTN_getQueryFromRequest() } $query .= " (" . $params . ") "; if ($_REQUEST['item_type'] == 'FUNCTION') { - if (! empty($_REQUEST['item_returntype']) && in_array($_REQUEST['item_returntype'], $cfg['ColumnTypes'])) { + // Make a flat array with column types + $columnTypes = array(); + foreach ($cfg['ColumnTypes'] as $key => $value) { + if (is_array($value)) { + $columnTypes = array_merge($value, $columnTypes); + } else { + $columnTypes[] = $value; + } + } + foreach ($columnTypes as $key => $type) { + if ($type == '-') { + unset($columnTypes[$key]); + } + } + // Search the flat array for the supplied return type + if (! empty($_REQUEST['item_returntype']) && in_array($_REQUEST['item_returntype'], $columnTypes)) { $query .= "RETURNS {$_REQUEST['item_returntype']}"; } else { $errors[] = __('You must provide a valid return type for the routine.');
hooks/post-receive